Converting a mysql time format 00:00:00 to 00:00 AM/PM with PHP
I'm trying to convert a time format from my mysql DB. The time stored in there is 12:00:00 and i want 开发者_JAVA技巧it to be displayed as 12:00 PM. How would i do this?
Here is what i tried:
$overdueTime = strftime('%I:%M %p', strtotime($settings_row[3]));
With $settings_row[3] being the time.
thanks in advance ^.^
Backend i converted it to military time:
strftime('%H:%M:%S strtotime($_POST["overdueTime"]));
Frontend i converted to 12 hour time:
strftime('%I:%M %p', strtotime($settings_row[3]));
精彩评论