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 . 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'. 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. 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() 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? 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 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? 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 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 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
Archived
This topic is now archived and is closed to further replies.