Convert from MySQL datetime to another format with PHP

// $datetime is something like: 2014-01-31 13:05:59
$time = strtotime($datetimeFromMysql);
$myFormatForView = date("d-m-Y g:i A", $time);
// $myFormatForView is something like: 01/31/14 1:05 PM

Comments

Popular posts from this blog

PHP: Date Difference for PHP 5.2

HTML5 video loop src change on end play function

Custom OpenCart 2.3.0.2 theme