For example, I have time in this format
eg. 09:15 AM 04:25 PM 11:25 AM
How to convert it to
09:15 16:25 23:25
My current code is:
$format_time = str_replace(" AM", "", $time, $count); if ($count === 0){ $format_time = strstr($time, ' PM', true); $format_time = ...... }
However, there seems to be a simpler and more elegant way to do this?
$time = '23:45'; echo date('g:i a', strtotime($time));
How to match the above sample in my case? Thanks
string date php
user1871516 Jun 06 '13 at 6:33 2013-06-06 06:33
source share