La funzione TIMESTAMP
Sintassi
TIMESTAMP(espr), TIMESTAMP(espr1, espr2)
Spiegazione
Chiamato con un solo argomento, restituisce l'espressione espr DATE o DATETIME come DATETIME. Con due argomenti, aggiunge l'espressione espr2 di tipo TIME all'espressione espr2 di tipo DATE o DATETIME e restituisce il risultato come DATETIME.
Esempi
MariaDB [(none)]> SELECT TIMESTAMP('2003-12-31'); +-------------------------+ | TIMESTAMP('2003-12-31') | +-------------------------+ | 2003-12-31 00:00:00 | +-------------------------+ 1 row in set (0.00 sec) MariaDB [(none)]> SELECT TIMESTAMP('2003-12-31 12:00:00','12:00:00'); +---------------------------------------------+ | TIMESTAMP('2003-12-31 12:00:00','12:00:00') | +---------------------------------------------+ | 2004-01-01 00:00:00 | +---------------------------------------------+ 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.