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. Quote 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. Quote 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 Quote 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. Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.