/ Published in: PHP

converts DateTIME, like 2009-06-11 10:30:40 into 06/11/2009 10:30 AM
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function readableDateTime($mySQLDateTime) { $datefixed = $d[1]."/".$d[2]."/".$d[0]; if ($t[0] <= 12) { $timefix = $t[0].":".$t[1]." AM"; } if ($t[0] > 12) { $timefix = ($t[0] - 12 ).":".$t[1]." PM"; } echo $datefixed." ".$timefix; }
Comments
