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);
精彩评论