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 Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 21, 2007 Share Posted February 21, 2007 print date("F d, Y", strtotime($date)); Quote Link to comment 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... Quote Link to comment Share on other sites More sharing options...
markkanning Posted February 21, 2007 Author Share Posted February 21, 2007 Jesi, Ted...Thanks! Worked great! mk Quote Link to comment 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.