Important
The SingleStore 9.1 release candidate (RC) is available now. It will be promoted to general availability (GA) soon and at that time it will be renamed to SingleStore 10.
In the interim, SingleStore 9.1 RC can be used to preview, evaluate, and provide feedback on the new and upcoming features in SingleStore 10, while SingleStore 9.0 is recommended for production workloads.
CONVERT_ TZ
On this page
The CONVERT_ function converts a given datetime object from one timezone to another.
Syntax
CONVERT_TZ (dateobj, oldtz, newtz)Arguments
-
date_: A validobj DATE,DATETIME, or parseable date string. -
old_andtz new_: Any valid timezone identifier.tz
Important
Timezone identifiers may be explicit intervals or named zones.+10:00 or -3:30 and are counted from UTC.America/Mazatlan or EST.
The list of supported timezone names is derived from https://www.
A copy of the timezones list is included in a text file -- memsql_ -- in the share directory of your SingleStore installation directory.
Return Type
A DATE or DATETIME object.date_, old_, or new_ is not valid, returns NULL.
Examples
SELECT CONVERT_TZ('2014-04-18 12:00:00','GMT','EST');
+-----------------------------------------------+
| CONVERT_TZ('2014-04-18 12:00:00','GMT','EST') |
+-----------------------------------------------+
| 2014-04-18 07:00:00 |
+-----------------------------------------------+SELECT CONVERT_TZ('2014-04-18 12:00:00','GMT','-3:14');
+-------------------------------------------------+
| CONVERT_TZ('2014-04-18 12:00:00','GMT','-3:14') |
+-------------------------------------------------+
| 2014-04-18 08:46:00 |
+-------------------------------------------------+Last modified: