.NET TimeZoneInfo Mistakes Time Saving in Morocco

Renouncement
While this question looked like a potential duplicate , it was resolved by referring to IsAmbiguousTime . This does not solve my problem, since the time when I notice a discrepancy does not report ambiguity.

Question, then ...
While timeanddate.com says that Morocco is observing daylight saving time from April 3 to July 31 this year and the current time provided by worldtimeserver.com seems to imply that it is, .NET TimeZoneInfo does not report Casablanca time as having any AdjusmentRules or AmbiguousTimeOffsets corresponding to 2011.

Indeed, if you set my computer’s clock to a time in Casablanca, it will set the current time one hour earlier than what is indicated as the current time in Casablanca through online resources.

Is the .NET library inaccurate in this regard, or are all other sources to blame? Given that the .NET library is an inaccurate source here, is this a common problem? The fact that I learned about this instance simply because a mismatch occurred in the first time zone in the .NET enumeration is a concern. Is this the basis for a local database that I can update myself?

0
source share
2 answers

As indicated in the MSDN entry for TimeZoneInfo.GetSystemTimeZones , .NET retrieves its information from the registry. Search Microsoft DST Support shows a fairly active history of time zone updates. Unfortunately, since December there have been no Casablanca updates, and in the December update it sounds like the daylight saving time settings for Morocco are lost.

+1
source

It seems that Morocco may have decided to abandon daylight saving time after this year. Microsoft seems to have jumped from a gun and removed DST early.

If you look at this link, please note that they say that in 2012 there are no DST changes.

http://www.timeanddate.com/worldclock/timezone.html?n=60

As DocMax says, DST is computed from the OS, so this is not a .NET problem. This is a problem with windows.

+2
source

Source: https://habr.com/ru/post/1384330/


All Articles