MySQL tutorial: CONVERT_TZ [EN]
top of page
CerebroSQL

MySQL: 

CONVERT_TZ

Syntax:
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. Time zones are specified as described in
https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html. This
function returns NULL if the arguments are invalid.

Example

mysql> SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET');
-> '2004-01-01 13:00:00'
mysql> SELECT CONVERT_TZ('2004-01-01 12:00:00','+00:00','+10:00');
-> '2004-01-01 22:00:00'

bottom of page