79717968

Date: 2025-07-28 23:17:27
Score: 0.5
Natty:
Report link

For question 1, I confirm that as at 2025 (Windows 10 and 11) the Registry continues to hold the list of time zone IDs in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones

These time zone IDs are unique strings to identify the time zone and are not for display to the user. The strings to display to the user can be found in the "Display" subkey (these are the strings that appear to the user when changing the time zone in Windows settings).

For example for Australia there are six such IDs:

ID: “W. Australia Standard Time”, display string “(UTC+08:00) Perth"
ID: “Aus Central W. Standard Time”, display string “(UTC+08:45) Eucla”
ID: “AUS Central Standard Time”, display string: “(UTC+09:30) Darwin”
ID: "Cen. Australia Standard Time”, display string: “(UTC+09:30) Adelaide”
ID: “AUS Eastern Standard Time”, display string: “(UTC+10:00) Canberra, Melbourne, Sydney”
ID: “E. Australia Standard Time”, display string “(UTC+10:00) Brisbane”

It can be seen that a couple of time zones in the above list have the same standard time UTC bias but have different IDs. This is because of differences in daylight saving. For example Brisbane does not have daylight saving whereas Canberra, Melbourne and Sydney do. They need separate time zone keys because the daylight saving information is kept in those keys.

Some 13 years ago the questioner reported that these strings were in the Registry and since this is documented by Microsoft both in the TIME_ZONE_INFORMATION structure information, and now also in the TimeZoneInfo.FindSystemTimeZoneById(String) Method information, I think it can be relied on for the future.

So these display strings can be extracted directly using the Registry API.

An alternative way is to use the FindSystemTimeZoneById method in the TimeZoneInfo interface and then read the DisplayName Property. The documentation states that on Windows systems this simply reads the Registry entries in the same way.

For question 2, yes the currently selected time zone is given in the TIME_ZONE_INFORMATION structure by a call to the GetTimeZoneInformation API. But this does not give you the display string. Instead, the "StandardName" as reported at +4h in that structure is the time zone ID. As mentioned in the answer to 1, the corresponding display string can be found in the Registry or by using the TimeZoneInfo interface.

Although current Windows documentation for TIME_ZONE_INFORMATION gives an example for StandardName that "EST could indicate Eastern Standard Time", this documentation dates back to 2022. I think the IDs have changed since then (naturally they will be updated from time to time). Currently "Eastern Standard Time" and not "EST" is the ID in the Registry for that time zone. The corresponding Display subkey holds "(UTC-05:00) Eastern Time (US and Canada)" for that time zone.

For question 3, in my case I only needed to know whether daylight saving was in operation for the currently selected time zone. This is returned in the eax register by the GetTimeZoneInformation API (a value of 2 showing that daylight saving is currently operating).

For other (not currently selected) time zones in 2025 it seems that various methods are available.

One is direct reading of the Registry as mentioned by Jesse.

Another is to enumerate the time zones by calling EnumDynamicTimeZoneInformation. That will give you the index of the time zone you want to look at. You can pass that index to GetTimeZoneInformationForYear. According to the documentation for the DYNAMIC_TIME_ZONE_INFORMATION structure, that reads the same Registry entries.

Now there are also methods in the TimeZoneInfo interface which can be used, like GetUtcOffset (you give the date and time zone ID and the bias is calculated) or IsDaylightSavingTime (you give the date and time zone ID and the function reports whether the date falls within daylight saving time for that time zone).

Reasons:
  • Blacklisted phrase (1): this document
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: jorgon