PHP-Convert the time from AM/PM to 24 hour format

by barkkathulla 2013-10-19 18:56:03

Convert the time from AM/PM to 24 hour format


// 24-hour time to 12-hour time
$time12hourformat = date("g:i a", strtotime("13:30"));

// 12-hour time to 24-hour time
$time24hourformat = date("H:i", strtotime("1:30 PM"));


896
like
0
dislike
0
mail
flag

You must LOGIN to add comments