jakebur01 Posted February 27, 2009 Share Posted February 27, 2009 What is the correct way to insert the date of a post into a mysql table and how should the mysql column be set up? I read somewhere that the correct format for xml / rss should be like Wed, 04 Feb 2008 13:00:00 GMT . Quote Link to comment https://forums.phpfreaks.com/topic/147171-solved-the-correct-datetime-for-a-post/ Share on other sites More sharing options...
rhodesa Posted February 27, 2009 Share Posted February 27, 2009 http://dev.mysql.com/doc/refman/5.1/en/datetime.html MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. Quote Link to comment https://forums.phpfreaks.com/topic/147171-solved-the-correct-datetime-for-a-post/#findComment-772584 Share on other sites More sharing options...
jakebur01 Posted February 27, 2009 Author Share Posted February 27, 2009 Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/147171-solved-the-correct-datetime-for-a-post/#findComment-772596 Share on other sites More sharing options...
shadiadiph Posted February 27, 2009 Share Posted February 27, 2009 when i insert i always use now() with no '' so not 'now()' just now() Quote Link to comment https://forums.phpfreaks.com/topic/147171-solved-the-correct-datetime-for-a-post/#findComment-772599 Share on other sites More sharing options...
jakebur01 Posted February 27, 2009 Author Share Posted February 27, 2009 What type of column should the MySQL table be. How should it be set up? Quote Link to comment https://forums.phpfreaks.com/topic/147171-solved-the-correct-datetime-for-a-post/#findComment-772610 Share on other sites More sharing options...
shadiadiph Posted February 27, 2009 Share Posted February 27, 2009 DATE for just the date DATETIME for date and time TIME for just time YEAR for just year Quote Link to comment https://forums.phpfreaks.com/topic/147171-solved-the-correct-datetime-for-a-post/#findComment-772616 Share on other sites More sharing options...
jakebur01 Posted February 27, 2009 Author Share Posted February 27, 2009 So if I set the column up as DATETIME and use now() in my insert query I should be good? Quote Link to comment https://forums.phpfreaks.com/topic/147171-solved-the-correct-datetime-for-a-post/#findComment-772623 Share on other sites More sharing options...
shadiadiph Posted February 27, 2009 Share Posted February 27, 2009 yep should be fine Quote Link to comment https://forums.phpfreaks.com/topic/147171-solved-the-correct-datetime-for-a-post/#findComment-772624 Share on other sites More sharing options...
jakebur01 Posted February 27, 2009 Author Share Posted February 27, 2009 thank you Quote Link to comment https://forums.phpfreaks.com/topic/147171-solved-the-correct-datetime-for-a-post/#findComment-772627 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.