TimeZoneInfo课程是否了解历史日光节省时间?

发布于 2025-02-09 04:20:13 字数 676 浏览 0 评论 0 原文

当我打电话 /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?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

比忠 2025-02-16 04:20:13

当我在某个timezoneinfo对象上调用isdaylightsavingtime时,会吗
考虑到当日光节省时间发生在
时区随着时间的变化而变化,或者甚至可能不再发生?

这种取决于过去一年的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 或类似的时区更改。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文