Declaration
CONVERT_TZ(dt,from_tz,to_tz)
Description
Converts the datetime value dt from the time zone specified by from_tz to the time zone specified by to_tz and returns the result. If the dt parameter is invalid, NULL is returned.
If this value exceeds the supported range of the TIMESTAMP type when converting from from_tz to UTC, the conversion will not occur. For details about the TIMESTAMP type range, see DATE, DATETIME and TIMESTAMP types.
Examples
obclient> SELECT CONVERT_TZ('2014-01-01 12:00:00','+00:00','+8:00');
+----------------------------------------------------+
| CONVERT_TZ('2014-01-01 12:00:00','+00:00','+8:00') |
+----------------------------------------------------+
| 2014-01-01 20:00:00 |
+----------------------------------------------------+
1 row in set