damdempsel Posted December 9, 2009 Share Posted December 9, 2009 On my website I have a news feed thing that I made. It use to work fine but I tried to use the DATETIME code that I just learned about. Whenever I do, it ends up displaying 0000-00-00 00:00:00. Does anyone know how I could get this to work? Quote Link to comment https://forums.phpfreaks.com/topic/184517-datetime/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 9, 2009 Share Posted December 9, 2009 Your code is producing an invalid DATETIME value, so the default is being inserted and that is what you get back when you attempt to display it. You would need to troubleshoot what your code is doing in order to find out why it is producing and tying to insert an invalid value into your table. Quote Link to comment https://forums.phpfreaks.com/topic/184517-datetime/#findComment-974076 Share on other sites More sharing options...
PravinS Posted December 9, 2009 Share Posted December 9, 2009 While inserting data in the table use MYSQL NOW() function to insert date, and while retrieving it from database use MYSQL DATE_FORMAT() function. Quote Link to comment https://forums.phpfreaks.com/topic/184517-datetime/#findComment-974077 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.