What's the point of using wordy Time Zones?

大城市里の小女人 提交于 2020-01-24 08:59:06

问题


I know this isn't specific to PHP, but what's the point of using timezones listed like this :http://us2.php.net/manual/en/timezones.america.php? For example "America/Indianapolis" and "America/New_York". What is the problem with EST, EDT, CST, CDT, &c?


回答1:


This is just a different timezone format provided by the Zoneinfo database:

The time zones in the database are given uniform names, such as “America/New_York”, in an attempt to make them easier to understand by humans and to remove ambiguity.




回答2:


'America/New_York' doesn't depend on the date. EST is only valid in winter, while in summer you have to change it to EDT. Other problem with 3 letter codes is, that there are conflicts. EST means Eastern Standard Time, but it might be in America or Australia.




回答3:


Time zones or daylight savings time start/end dates of cities might change (it did occur in the past) but the cities are likely to remain at the same location.




回答4:


All regions within a timezone don't follow the same rules. For example, Arizona does not observe Daylight Saving Time.




回答5:


http://us2.php.net/date_default_timezone_set

Quote from page: Note: Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn't valid, and/or a E_STRICT message if using the system settings or the TZ environment variable.




回答6:


"America/Indianapolis" and "America/New_York" are called TZID (Timezone Identifier) from the tz database (also called zoneinfo database or IANA time zone database or Olson database).

The tz database partitions the world into regions where local clocks have all been the same since 1970.

This means that when specifying a TZID, you can accurately and without ambiguity date any local event in the world occurring since 1 January 1970 (Unix Epoch).

This may seem convenient together with a Unix timestamp. Yet, beware of 32 bits programs as they will report negative values with the year 2038 problem.

"EST", "EDT", "CST" and "CDT" are often abbreviations of The Microsoft Windows Time Zone Database and lead to ambiguities as they aren't unique (compare "Central Standard Time", "Central Summer Time", "China Standard Time" and "Cuba Standard Time").

More advantages/disadvantages are given on https://stackoverflow.com/tags/timezone/info.



来源:https://stackoverflow.com/questions/709350/whats-the-point-of-using-wordy-time-zones

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