View Single Post
Old 19-08-2005, 16:12   #11
BlueDragon
Senior Member
 
L'Avatar di BlueDragon
 
Iscritto dal: Dec 2002
Messaggi: 418
Quote:
Originariamente inviato da MySQL Reference Manual
STR_TO_DATE(str,format)
This is the reverse function of the DATE_FORMAT() function. It takes a string str and a format string format. STR_TO_DATE() returns a DATETIME value if the format string contains both date and time parts, or a DATE or TIME value if the string contains only date or time parts.
Questa fa al caso tuo

Il formato per Fri Aug 19 15:32:38 2005 dovrebbe essere...
%a %b %e %k:%i:%s %Y

%k è 0-23...forse hai bisogno di %H (00-23). Controlla anche minuti e secondi per vedere se anche loro possono avere questo problema.
Controlla a pagina 659 della documentazione, dove c'è la megatabellona per i formati di DATE_FORMAT (valgono anche per STR_TO_DATE).




Per quanto riguarda ctime e asctime:
Quote:
Originariamente inviato da http://www.cplusplus.com/ref/
asctime Convert tm structure to string
ctime Convert time_t value to string
Secondo la descrizione breve di quel sito non vanno bene...fanno la conversione nel verso sbagliato
BlueDragon è offline   Rispondi citando il messaggio o parte di esso