GET_FORMAT

Stai visualizzando una vecchia versione di questo article. Visualizza la versione più recente.

Sintassi

GET_FORMAT({DATE|TIME|DATETIME}, {'EUR'|'USA'|'JIS'|'ISO'|'INTERNAL'})

Spiegazione

Restituisce una stringa che rappresenta un formato. Questa funzione è utile se in combinazione con DATE_FORMAT() e STR_TO_DATE().

Esempi

MariaDB [(none)]> SELECT DATE_FORMAT('2003-10-03',GET_FORMAT(DATE,'EUR'));
+--------------------------------------------------+
| DATE_FORMAT('2003-10-03',GET_FORMAT(DATE,'EUR')) |
+--------------------------------------------------+
| 03.10.2003                                       |
+--------------------------------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT STR_TO_DATE('10.31.2003',GET_FORMAT(DATE,'USA'));
+--------------------------------------------------+
| STR_TO_DATE('10.31.2003',GET_FORMAT(DATE,'USA')) |
+--------------------------------------------------+
| 2003-10-31                                       |
+--------------------------------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> 

Commenti

Sto caricando i commenti......
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.