How would you change the format of the DATETIME from a MySQL Database.
Code:
echo $r["date"];
echo date("F j, g:ia",$r["date"]);
Output:
2014-02-05 15:31:51
December 31, 6:33pm
These are both two different dates, not sure why.
How would you change the format of the DATETIME from a MySQL Database.
Code:
echo $r["date"];
echo date("F j, g:ia",$r["date"]);
Output:
2014-02-05 15:31:51
December 31, 6:33pm
These are both two different dates, not sure why.
Use strtotime
echo date("F j, g:ia",strtotime($r["date"]));
The second parameter for the date function requires a timestamp. strtotime converts a date string to a timestamp.