开发者

How to determine if current locale has 24-hour or 12-hour time format in PHP?

This seems like a dumb question, but I've read the docs and couldn't find any straight-forward method.

I did something awful like:

$isTwentyFourByLocale = (substr(strftime('%X', mktime(16, 0, 0, 6, 1开发者_Python百科5, 2010)), 0, 2) == 16);

Which works, but isn't there any better, straight-forward way?


Using your approach, it can be done shorter:

$isTwentyFourByLocale = (substr(gmstrftime('%X', 57600), 0, 2) == 16);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜