What do I put in date_default_timezone_set?

倖福魔咒の 提交于 2019-12-13 06:21:02

问题


I'm not from the US but I want to use date_default_timezone_set and set it to Englewood, Colorado. What do I use? I can't find any America/Englewood or America/Colorado in the documentation. Any help?


回答1:


As google tells me that Colorado is in the 'Mountain Time Zone' use US/Mountain from the documentation




回答2:


The correct TZDB zone name is America/Denver.

US/Mountain is an alias that presently resolves to America/Denver, but it may not always be that way in the future.

The US/* aliases are there for backwards compatibility only, and do not follow the normal naming conventions of the IANA/Olson time zones that PHP uses.

From the PHP documentation:

Warning

Please do not use any of the timezones listed here (besides UTC), they only exist for backward compatible reasons.

See also: Are 'US/Eastern' and 'US/Central' and 'US/Pacific' deprecated for strftime or just PHP?



来源:https://stackoverflow.com/questions/16446037/what-do-i-put-in-date-default-timezone-set

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!