What are the “standard” time zone abbreviations?

I save the offset-from-UTC timezone for an application using this drop-down menu:

<select id="timezone" name="timezone" > <option value="-12">[UTC - 12] Baker Island Time</option> <option value="-11">[UTC - 11] Niue Time, Samoa Standard Time</option> <option value="-10">[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time</option> <option value="-9.5">[UTC - 9:30] Marquesas Islands Time</option> <option value="-9">[UTC - 9] Alaska Standard Time, Gambier Island Time</option> <option value="-8">[UTC - 8] Pacific Standard Time</option> <option value="-7">[UTC - 7] Mountain Standard Time</option> <option value="-6">[UTC - 6] Central Standard Time</option> <option value="-5">[UTC - 5] Eastern Standard Time</option> <option value="-4.5">[UTC - 4:30] Venezuelan Standard Time</option> <option value="-4">[UTC - 4] Atlantic Standard Time</option> <option value="-3.5">[UTC - 3:30] Newfoundland Standard Time</option> <option value="-3">[UTC - 3] Amazon Standard Time, Central Greenland Time</option> <option value="-2">[UTC - 2] Fernando de Noronha Time, South Georgia &amp; the South Sandwich Islands Time</option> <option value="-1">[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time</option> <option value="0">[UTC] Western European Time, Greenwich Mean Time</option> <option value="1">[UTC + 1] Central European Time, West African Time</option> <option value="2">[UTC + 2] Eastern European Time, Central African Time</option> <option value="3">[UTC + 3] Moscow Standard Time, Eastern African Time</option> <option value="3.5">[UTC + 3:30] Iran Standard Time</option> <option value="4">[UTC + 4] Gulf Standard Time, Samara Standard Time</option> <option value="4.5">[UTC + 4:30] Afghanistan Time</option> <option value="5">[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time</option> <option value="5.5">[UTC + 5:30] Indian Standard Time, Sri Lanka Time</option> <option value="5.75">[UTC + 5:45] Nepal Time</option> <option value="6">[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time</option> <option value="6.5">[UTC + 6:30] Cocos Islands Time, Myanmar Time</option> <option value="7">[UTC + 7] Indochina Time, Krasnoyarsk Standard Time</option> <option value="8">[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time</option> <option value="8.75">[UTC + 8:45] Southeastern Western Australia Standard Time</option> <option value="9">[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time</option> <option value="9.5">[UTC + 9:30] Australian Central Standard Time</option> <option value="10">[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time</option> <option value="10.5">[UTC + 10:30] Lord Howe Standard Time</option> <option value="11">[UTC + 11] Solomon Island Time, Magadan Standard Time</option> <option value="11.5">[UTC + 11:30] Norfolk Island Time</option> <option value="12">[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time</option> <option value="12.75">[UTC + 12:45] Chatham Islands Time</option> <option value="13">[UTC + 13] Tonga Time, Phoenix Islands Time</option> <option value="14">[UTC + 14] Line Island Time</option> 

Using PHP, I actually don’t have the easiest options for converting them to reduced time reductions, my only way to do this programmatically is to sort the list of about 400 abbreviations in the time zone. Does anyone know a list that matches this drop-down list of what each time zone is, and what are they when daylight saving time occurs? (I assume that I need to define both lists manually)

EDIT: parsed this list to one abbreviation for each time zone, but they are not “popular”.

My new listing

 [-12] => kwat [-11] => bst [-10] => ahst [-9.5] => ckhst [-9] => ahdt [-8] => akdt [-7] => east [-6] => cst [-5] => act [-4.5] => ant [-4] => acst [-3.5] => negt [-3] => adt [-2] => addt [-1] => azost [-0] => azomt [1] => bst [2] => bdst [3] => amt [3.5] => irst [4] => adt [4.5] => aft [5] => aktt [5.5] => ist [5.75] => npt [6] => aktst [6.5] => burt [7] => almst [8] => bnt [8.75] => cwst [9] => cdt [9.5] => cast [10] => chost [10.5] => cst [11] => anat [11.5] => lhst [12] => anast [12.75] => chast [13] => anast [14] => anast 

the code:

 $abbr = DateTimeZone::listAbbreviations(); $offsets=array('-12','-11','-10','-9.5','-9','-8','-7','-6', '-5','-4.5','-4','-3.5','-3','-2','-1','-0','1','2','3','3.5', '4','4.5','5','5.5','5.75','6','6.5','7','8','8.75','9','9.5', '10','10.5','11','11.5','12','12.75','13','14'); $new = array(); $count = 0; $found = false; while($count < count($offsets)) { foreach($abbr as $k => $v) { foreach($v as $tz) { if($tz['offset'] == $offsets[$count]*3600) { $new[$offsets[$count]] = $k; $found = true; break; } } if($found) { $found = false; break; } } $count++; } print_r($new); 
+8
timezone php time utc gmt
source share
1 answer

What are the “standard” time zone abbreviations?

There are no standards for this. Time zone abbreviations are not officially coordinated by anyone. Some of them are used in IANA TZDB , but many of them were just randomly selected. It is often discussed which abbreviations should be used. For example, look at how many posts there were about Australian abbreviations in April 2013 list archives.

Another list of time zone abbreviations can be found here . If you look carefully, you will see that many are ambiguous. For example, CST might be Central Standard Time (US), Chinese Standard Time, or Cuba Standard Time. EST can be Eastern Standard Time (US) or Eastern Standard Time (Australia).

Some non-Australians may prefer AEST , but who says that A should be for Australia and not for America?

Another very common example: some people use HAST for the Hawaiian Islands, while others use HST because they can take less care of the Aleutian islands in Alaska (which should represent A ).

The bottom line is that any list of time zone abbreviations, wherever you are, will be subjective and self-confident. There are no standards.

I save the time zone by offset for the application using this drop-down menu:

Please do not do this. The time zone is not an offset, and there are many more than 24. Read the time zone topic wiki , especially the "Time Zone! = Offset" section.

From your comments:

I understand this now, however the rest of my application logic depends on it already, and I only have today to complete it, so there is no time to change it.

Then many errors will be present in your application. You simply cannot do it reliably - even if your application just works in the USA. No matter what language or platform you are on, any implementation that will have many conversion errors.

I am fine with the hard coding of these arrays, I just don’t know what popular zones are located outside the USA, I thought that such a list already exists somewhere.

When it comes to time zones, you don't have to hardcode anything. Time zone rules change all the time because they are controlled by politicians in every country in the world. There are updates released several times a year in the IANA time zone database . On the PHP side, the PHP documentation makes it clear which version is currently available, and that updates are processed through PECL timezonedb - which retrieves data from IANA.

Regarding what is "popular" - this is also very subjective. Zones in TZDB exist for one reason or another. The only place I know that has tried to limit this is Ruby on Rails ActiveSupport :: TimeZone . They claim to have a “meaningful subset of 146 zones” that you can see in the MAPPING constant on this page. But they do not say by what process they decided what is considered significant, and there are obvious omissions. If you do not know where each of your users will be located, I would not try to decide which zones to limit.

If your follow-up is something else, which is a drop-down list of all 578 zones in TZDB, you can try one of these approaches:

  • Imagine two slopes. Be the first to choose a country. The second is to choose a zone within this country. In PHP, you can see that when you call DateTimeZone::listIdentifiers , it takes an optional $country parameter to filter the list.

    A good example of this is the setting for Google Calendar:

    Google Calendar Time Zone Settings

  • Use a map-based control so your user can select their time zone by location. There are many, but my favorite is this one for JavaScript.

    For example, it might look like this:

    Map-based TZ picker

Please note that while it shows the abbreviation TZDB EDT here - it is just used for display convenience. Under the hood, you select a value of type America/New_York .

Ultimately, you need to keep your IANA timezone key for each user, such as America/New_York . You cannot do the correct time zone conversions with just the value -5 , because you do not have all the rules when it switches to -4 .

Update

One thing that I did not understand from your original post, but you explained in the comments, is that you use this to select the time zone of the target event. I guess I should have set the context first. I came close to this in terms of choosing one time zone for your user, rather than a specific time zone for a specific event.

All you really need for the event to be at the right moment is the offset at that moment. This way you can use the dropdown like the one you provided in your question, but I would omit the zone names. This will list offsets from UTC-12:00 to UTC+14:00 . It looks like you have already determined that there is also a 30 minute and 45 minute offset. You can check your assumptions here if you want.

However, the common problem is that many people do not know what offset is. By placing a list with a standard offset for each zone name, you can mislead the user to select the wrong offset. For example, they can talk about the summer date, which should fall into US Eastern Daylight Saving Time (-4), but instead they choose -5 because they see "Eastern." Therefore, deleting names will help.

If you go as I originally suggested, and have them select the actual IANA time zone, this will work much better for many scenarios. However, there is another scenario that you need to think about - how to deal with ambiguous and invalid times. This happens during DST transitions.

For example, I could choose America/New_York and choose the time 1:00 AM on November 3, 2013. There are two different examples due to the transition to recession (one in EDT at -4 and the other in EST at -5). Thus, your application will need to verify this and ask the user which one they had in mind. Similarly, if I log in at 2:00 AM on March 10, 2013, your application should tell me that this time it does not exist in this zone (due to the spring-forward transition).

With either approach, when it comes to actually storing the time of the event, make sure that you either keep the combination of date and time, or use an offset to get the date-time specified in UTC. You do not want to have a question about what actual moment of time is represented by the event.

+24
source share

All Articles