PHP时间格式,上午和下午带句点 [英] PHP time format, am and pm with periods
本文介绍了PHP时间格式,上午和下午带句点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将php时间格式调整为包含时间段的上午和下午?
How could I adjust the php time format to a.m and p.m with the periods included?
date('h:i a');
推荐答案
使用可以轻松完成str_replace
:
str_replace(array('am','pm'),array('a.m','p.m'),date('h:i a'));
希望这会有所帮助
这篇关于PHP时间格式,上午和下午带句点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文