This is a read-only copy of the MariaDB Knowledgebase generated on 2024-12-22. For the latest, interactive version please visit https://mariadb.com/kb/.

CONVERT_TZ

Sintassi

CONVERT_TZ(dt, da_tz, a_tz)

Spiegazione

CONVERT_TZ() converte un valore datetime dt dalla timezone specificata con da_tz alla timezone specificata con a_tz e restituisce il risultato. Le timezone (fusi orari) sono descritte alla pagina http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html. Questa funzione restituisce NULL se gli argomenti non sono validi.

Esempi

MariaDB [(none)]> 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.00 sec)

MariaDB [(none)]> SELECT CONVERT_TZ('2004-01-01 12:00:00','+00:00','+10:00');
+-----------------------------------------------------+
| CONVERT_TZ('2004-01-01 12:00:00','+00:00','+10:00') |
+-----------------------------------------------------+
| 2004-01-01 22:00:00                                 |
+-----------------------------------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.