Easty way to convert 2004-12-05 style date (mysql) to December 5, 2004 in PHP
//format date for printing
//I already have variable $mysqlDate which is 2004-12-05
//Remove the '-' from the standar MySQL sate formatlist($Year,$Month,$Day) = split('-',$mysqlDate);
//Create a UNIX style timestamp from the result
$stampeddate = mktime(12,0,0,$Month,$Day,$Year);
$displayDate = date("F j, Y",$stampeddate);
print $displayDate;
I got this from a forum posting of njgMike99. You can do conversion when accessing mysql but it is easy for me to think in php even that means I need to convert it to unix timestamp once. Am I crazy?
Related posts:

One Comment
here is a good website for formatting dates using the date_format function