Skip to content
Advertisement

Convert deprecated/PHP’s ‘other time zones’ to standardized time zones

The PHP manual at https://www.php.net/timezones.others says to not use any of the time zones listed on that page besides UTC however the page does not provide a conversion map. My searches have only yielded unrelated/generic results.

Is there an existing list that converts deprecated time zones to standardized time zones that I can use to create proper associations in my database?

Advertisement

Answer

PHP uses IANA TZDB time zones.

Some of the ones listed in the “others” page in the PHP docs are TZDB links to their canonical zones. For example: Africa/Asmera is a link to Africa/Nairobi. While the latter is preferred, there’s nothing wrong with using the former. They will both continue to work, and continue to be represented in the source data.

Others on that page are “administrative zones”. For example, Etc/GMT+11, which has its sign intentionally inverted, representing a fixed offset of UTC-11. These are valid, but should only be used in special cases, such as for ships at sea that are not in territorial waters. All locations on land (and in territorial waters) should use a location-based zone name.

Yet others on those pages are in an older format that should be discouraged, but are still valid links. For example Cuba is a valid link to America/Havana, but should be discouraged because it’s not in the area/locality format.

Lastly, there are zones on that page that should be considered deprecated but do not have a link to a canonical zone. For example EST5EDT is a zone that may have been used for “Eastern Time” – but cannot be cleanly mapped to a zone like America/New_York because it does not have any of the historical changes that occured in New York, and there are other entries in the Eastern time zone that had different histories than New York.

In short, you may be able to map some of those zones to their preferred representations by following links in the TZDB sources, but some can’t be mapped and others shouldn’t.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement