I'm looking for a way to convert army time (such as 23:00) to regular time with the AM/PM expression.
Just pass your time in strtotime
function like this:
$time_in_12_hour_format = date("g:i a", strtotime("23:00"));
echo $time_in_12_hour_format;
http://www.php.net/manual/en/function.date.php
$army_time_str = "23:00";
$regular_time_str = date( 'g:i A', strtotime( $army_time_str ) );
echo $regular_time_str;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With