当我打电话 /code> 在某些 timezoneinfo
对象上,是否会考虑到当天储蓄时间在时区中发生随时间变化,还是不再发生?
例如,美国可以批准一项新法律 从2023年11月开始,该法律这是生效的,这个班级会仍然认识到过去的日期在DST之下,而未来的日期永远不会?
(实际上,该法案计划制定永久性的“ DST”,因此,跟进,这意味着TimeZoneInfo的行为好像时区在2023年11月在DST上永恒地在DST中?)
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)
这种取决于过去一年的Windows注册表中是否存在于
HKEY_LOCAL_MACHINE \ SOFTWARE \ MICROSOFT \ Windows \ Windows nt \ CurrentVersion \ Sighterver \时区
路径。您可以检查注册表中的每个子钥匙,以查看每个时区的后退多远。 (在这里如何阅读reg_binary tzi有关注册表的信息如果您像我一样好奇),即使您发现,数据可能会出现一些错误或可能不完整。通常,您可以在 iana数据库a href =“ https://nodatime.org/” rel =“ nofollow noreferrer”> noda Time 。
顺便说一句,Microsoft具有博客如果您有兴趣。他们通常会发布文章时,当他们发布Windows更新时,任何 dst 或类似的时区更改。
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.