在PHP中将军队时间转换为常规时间AM PM [英] Convert army time to regular time AM PM in PHP
本文介绍了在PHP中将军队时间转换为常规时间AM PM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一种通过AM/PM表达式将陆军时间(例如23:00)转换为正常时间的方法.
I'm looking for a way to convert army time (such as 23:00) to regular time with the AM/PM expression.
推荐答案
只需在strtotime
函数中花费时间,就像这样:
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;
这篇关于在PHP中将军队时间转换为常规时间AM PM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文