ProAnswers.org

Format mysql datetime with php?

I have a datetime column in mysql which I need to convert to mm/dd/yy H:M (AM/PM) using PHP.

This worked the best for me:

$datetime = strtotime($row->createdate);
$mysqldate = date(“m/d/y g:i A”, $datetime);