CONVERT_TZ()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Converts the given DATETIME
value from the first time zone to the second time zone.
USAGE
CONVERT_TZ(date_time, timezone_from, timezone_to)
Argument Name | Description |
---|---|
| The datetime to convert |
| The time zone to covert from |
| The time zone to covert to |
DETAILS
CONVERT_TZ()
is a date-time function that converts the given DATETIME
value from the first time zone to the second time zone.
A NULL
is returned if any argument is NULL
.
EXAMPLES
SELECT CONVERT_TZ('2020-01-01 12:00:00', '+00:00', '+5:00') AS result;
+----------------------------+
| result |
+----------------------------+
| 2020-01-01 17:00:00.000000 |
+----------------------------+