markkanning Posted February 21, 2007 Share Posted February 21, 2007 Hey all, I've got some news articles in a DB that each have a date field(formatted as YYYY-MM-DD). I simply want to SELECT them from the DB, ORDER BY the date, them loop them with the date reading like "January 14, 2006". Is there a simple PHP string formatting method for turning 2006-01-14 into January 14, 2006? Thanks, mk Link to comment https://forums.phpfreaks.com/topic/39523-turn-mysql-date-into-nice-reading-php-date/ Share on other sites More sharing options...
Jessica Posted February 21, 2007 Share Posted February 21, 2007 print date("F d, Y", strtotime($date)); Link to comment https://forums.phpfreaks.com/topic/39523-turn-mysql-date-into-nice-reading-php-date/#findComment-190715 Share on other sites More sharing options...
ted_chou12 Posted February 21, 2007 Share Posted February 21, 2007 $date = "2006-01-14"; strtotime($date); $date = date("F d, Y", $date); echo $date; Ted someones faster... Link to comment https://forums.phpfreaks.com/topic/39523-turn-mysql-date-into-nice-reading-php-date/#findComment-190716 Share on other sites More sharing options...
markkanning Posted February 21, 2007 Author Share Posted February 21, 2007 Jesi, Ted...Thanks! Worked great! mk Link to comment https://forums.phpfreaks.com/topic/39523-turn-mysql-date-into-nice-reading-php-date/#findComment-190718 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.