PHP Date Conversion [duplicate]
Possible Duplicate:
Format mysql datetime with php
How to convert the following:
2010-12-07 12:00:00
into:
December, 7th, 2010
echo date("F, jS, Y", strtotime("2010-12-07 12:00:00"));
http://php.net/manual/en/function.date.php
Check out the date function.
$myDate = strtotime('2010-12-07 12:00:00');
$formattedDate = date('F, jS, Y', $myDate)
Use date_format
http://www.php.net/manual/en/function.date-format.php
$date = date_create('2010-12-07 12:00:00');
echo date_format($date, 'F, jS, Y');
echo date('F, jS, Y',strtotime('2010-12-07 12:00:00'));
$d = strtotime('2010-12-07 12:00:00');
echo date('F, jS, Y', $d);
精彩评论