MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / calc_time_from_sec

Function calc_time_from_sec

sql/sql_time.cc:643–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643void calc_time_from_sec(MYSQL_TIME *to, longlong seconds, long microseconds)
644{
645 long t_seconds;
646 // to->neg is not cleared, it may already be set to a useful value
647 to->time_type= MYSQL_TIMESTAMP_TIME;
648 to->year= 0;
649 to->month= 0;
650 to->day= 0;
651 DBUG_ASSERT(seconds < (0xFFFFFFFFLL * 3600LL));
652 to->hour= (long) (seconds / 3600L);
653 t_seconds= (long) (seconds % 3600L);
654 to->minute= t_seconds/60L;
655 to->second= t_seconds%60L;
656 to->second_part= microseconds;
657}
658
659
660/*

Callers 1

mix_date_and_timeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected