MCPcopy Create free account
hub / github.com/MariaDB/server / time_to_datetime

Function time_to_datetime

sql/sql_time.cc:887–900  ·  view source on GitHub ↗

Convert TIME to DATETIME. @param ltime The value to convert. @return false on success, true of error (negative time). */

Source from the content-addressed store, hash-verified

885 @return false on success, true of error (negative time).
886*/
887bool time_to_datetime(MYSQL_TIME *ltime)
888{
889 DBUG_ASSERT(ltime->time_type == MYSQL_TIMESTAMP_TIME);
890 DBUG_ASSERT(ltime->year == 0);
891 DBUG_ASSERT(ltime->month == 0);
892 DBUG_ASSERT(ltime->day == 0);
893 if (ltime->neg)
894 return true;
895 uint day= ltime->hour / 24;
896 ltime->hour%= 24;
897 ltime->month= day / 31;
898 ltime->day= day % 31;
899 return false;
900}
901
902
903/*** Conversion from TIME to DATETIME ***/

Callers 3

make_from_timeMethod · 0.85

Calls 3

time_to_datetime_oldFunction · 0.85
set_current_dateFunction · 0.85
mix_date_and_timeFunction · 0.85

Tested by

no test coverage detected