kortoom Posted October 10, 2009 Share Posted October 10, 2009 Thank you to Daniel Egeberg for the great article on this topic... I have a DATE field in MySql called 'date_created' that stores a date like this: 2009-09-30 I want to format that date like this: September 30, 2009 Which should be accomplished with this: $date_created=date("F j, Y ", $row['date_created']); echo $date_created; Instead, this line of code outputs "December 31, 1969", no matter what date is in the database. Please help! Link to comment https://forums.phpfreaks.com/topic/177216-date-formatting-from-mysql/ Share on other sites More sharing options...
xenophobia Posted October 10, 2009 Share Posted October 10, 2009 try: $date_created=date("F j, Y ", strtotime($row['date_created'])); Link to comment https://forums.phpfreaks.com/topic/177216-date-formatting-from-mysql/#findComment-934426 Share on other sites More sharing options...
kortoom Posted October 10, 2009 Author Share Posted October 10, 2009 Perfect!!!!! You're awesome -- thank you very much! Link to comment https://forums.phpfreaks.com/topic/177216-date-formatting-from-mysql/#findComment-934430 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.