.NET TimeZoneInfo有关摩洛哥夏令时的错误 [英] .NET TimeZoneInfo wrong about Morocco daylight savings

查看:177
本文介绍了.NET TimeZoneInfo有关摩洛哥夏令时的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明

此这个问题看起来像是潜在的重复对象,它通过引用 IsAmbiguousTime 得到解决。这并不能解决我的问题,因为据报道我注意到差异的时间并不明确。

Disclaimer
While this question looked like a potential duplicate, it was resolved by referring to IsAmbiguousTime. This does not solve my problem, as the time where I'm noticing discrepancies is not reported to be ambiguous.

问题,那么...

timeanddate.com 说摩洛哥观察到今年4月3日至7月31日之间的夏令时,以及 worldtimeserver.com 似乎暗示是这种情况,.NET TimeZoneInfo 不会报告卡萨布兰卡时间,因为它具有任何 AdjusmentRules AmbiguousTimeOffsets 与2011年有关。

The question, then...
While timeanddate.com says Morocco observes daylight savings between April 3 and July 31 this year, and the current time as provided by worldtimeserver.com seems to imply that this is the case, the .NET TimeZoneInfo does not report Casablanca time as either having any AdjusmentRules or AmbiguousTimeOffsets relevant to the year 2011.

确实,将计算机的时钟设置为卡萨布兰卡时间,它将将当前时间设置为比在线资源在卡萨布兰卡的当前时间早一小时。

Indeed, setting my computer's clock to Casablanca time, it will set the current time to one hour earlier than what is cited as the current time in Casablanca by online resources.

.reg库中的.NET库是否不正确? rd,还是所有其他来源都有错?鉴于.NET库在这里是不准确的来源,这是一个普遍的问题吗?我仅仅因为差异发生在.NET枚举的 first 时区而发现了这个实例,这一事实令人不安。

Is the .NET library inaccurate in this regard, or are all other sources at fault? Given that the .NET library is the inaccurate source here, is this a common problem? The fact that I found out about this instance simply because the discrepancy occurred in the first time zone in the .NET enumeration is unsettling. Is this based on a local database that I can keep updated myself?

推荐答案

如MSDN条目中 TimeZoneInfo.GetSystemTimeZones ,.NET从注册表中获取其信息。搜索 Microsoft对DST的支持显示了相当活跃的时区更新历史。不幸的是,自12月以来没有卡萨布兰卡的更新,12月的更新听起来像是取消了摩洛哥的夏令时设置。

As noted in the MSDN entry for TimeZoneInfo.GetSystemTimeZones, .NET gets its information from the registry. Searching Microsoft Support for DST shows a pretty active history of time zone updates. Unfortunately, there have been no Casablanca updates since December, and the December update sounds like it removed daylight savings settings for Morocco.

这篇关于.NET TimeZoneInfo有关摩洛哥夏令时的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆