freeloader Posted June 28, 2009 Share Posted June 28, 2009 I have a table called DB_Messages. It has columns MessageID, Sender, Content, SentTime. That last field is a datetime field. When I run following query: INSERT IGNORE INTO DB_Messages (MessageID, Sender, Content, SentTime) VALUES('12345', 'Test', 'Test msg', '2009-27-06 12:59:00') Everything gets inserted in the db neatly, but the time stamp is suddenly '0000-00-00 00:00:00'. I really can't seem to see the bug here. Any help appreciated. Link to comment https://forums.phpfreaks.com/topic/163938-solved-datetime-doesnt-want-to-insert/ Share on other sites More sharing options...
Ken2k7 Posted June 28, 2009 Share Posted June 28, 2009 Format is YYYY-MM-DD not YYYY-DD-MM. Link to comment https://forums.phpfreaks.com/topic/163938-solved-datetime-doesnt-want-to-insert/#findComment-864906 Share on other sites More sharing options...
PFMaBiSmAd Posted June 28, 2009 Share Posted June 28, 2009 Unless you live on a planet that has at least 27 months Link to comment https://forums.phpfreaks.com/topic/163938-solved-datetime-doesnt-want-to-insert/#findComment-864908 Share on other sites More sharing options...
Ken2k7 Posted June 28, 2009 Share Posted June 28, 2009 Unless you live on a planet that has at least 27 months ... in a calendar year. Link to comment https://forums.phpfreaks.com/topic/163938-solved-datetime-doesnt-want-to-insert/#findComment-864910 Share on other sites More sharing options...
freeloader Posted June 28, 2009 Author Share Posted June 28, 2009 Ah right, I mixed up there, I'm used to other date format in Belgium. Thanks. Link to comment https://forums.phpfreaks.com/topic/163938-solved-datetime-doesnt-want-to-insert/#findComment-865064 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.