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?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
"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).
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.
All regions within a timezone don't follow the same rules. For example, Arizona does not observe Daylight Saving Time.
'America/New_York'
doesn't depend on the date.EST
is only valid in winter, while in summer you have to change it toEDT
. Other problem with 3 letter codes is, that there are conflicts.EST
means Eastern Standard Time, but it might be in America or Australia.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.
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.
This is just a different timezone format provided by the Zoneinfo database: