Does the TimeZoneInfo class know about historical Daylight Savings times?

Viewed 39

When I call IsDaylightSavingTime on some TimeZoneInfo object, will it take into account the fact that when daylight savings time occurs in a timezone has changed over time, or may even no longer occur?

For example, the US may ratify a new law that abolishes DST altogether starting in November 2023. If this goes into effect, will this class still recognize that past dates were under DST, and that future dates will never be?

(Actually the bill in question plans to enact permanent a 'DST' so, follow up, will that mean that TimeZoneInfo acts as if the timezone is eternally in DST for dates past Nov. 2023?)

1 Answers

When I call IsDaylightSavingTime on some TimeZoneInfo object, will it take into account the fact that when daylight savings time occurs in a timezone has changed over time, or may even no longer occur?

This kind of depends on that past year exist in the Windows registry or not on HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zone path. You can check each subkey in the registry to see how far back it goes for each timezone. (Here how you can read REG_BINARY TZI information on registry if you are curious like me)

Even if you find, the data might have some errors or can be incomplete. Usually, you can find the best data for historical times on IANA database which you can use with Noda Time.

By the way, Microsoft has Daylight Saving Time & Time Zone blog if you interested. They usually post articles when they release a windows update for any DST or similar timezone change.

Related