Problema Data | SQL & MySQL

Topic: Pubblico - Composto da 3 Posts di 3 Utenti.

30 Settembre, 2011 12:44 #1
ic3kym
Utente

ic3kym
Registrato: Sep, 2011
Posts: 8
Offline

Ciao a tutti, avevo una domanda da porre.
Ho bisogno di aggiungere un orario alla funzione curdate().
Qualcuno ha idea di come si fa?
es. curdate() restituisce 30-09-2011 io avrei necessità di aggiungere l'orario 9:00 ovvero ottenere:
30-09-2011 09:00

Grazie

30 Settembre, 2011 14:10 #2
darasc
Moderatore

darasc
Registrato: Jul, 2010
Posts: 64
Offline

Ciao,

utilizza la funzione now(), che ti restituisce il DATETIME corrente.

30 Settembre, 2011 23:17 #3
fuser
Utente

fuser
Registrato: Aug, 2011
Posts: 86
Offline

Però MySQL di default usa un altro formato, per avere il formato che dici tu:
SELECT DATE_FORMAT(NOW(), '%d-%m%Y %i:%H');

Condividi su:

Loggati o Registrati per replicare