Mega Code Archive

 
Categories / MySQL Tutorial / Date Time Functions
 

CONVERT_TZ(dt,from_tz,to_tz)

CONVERT_TZ() converts a datetime value dt from the time zone given by from_tz to the time zone given by to_tz and returns the resulting value. CONVERT_TZ() returns NULL if the arguments are invalid. mysql> mysql> SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET'); +-----------------------------------------------+ | CONVERT_TZ('2004-01-01 12:00:00','GMT','MET') | +-----------------------------------------------+ | NULL                                          | +-----------------------------------------------+ 1 row in set (0.02 sec)