Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 54480 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 21199 [details]
Program demonstrating the issue
Version 4.8.0 running on Ubuntu 16.04
(Discovered when validating Noda Time behaviour.)
The adjustment rules returned by TimeZoneInfo.GetAdjustmentRules() don't correctly describe the zone it's called on in all cases. The attached program demonstrates this using Africa/Tunis.
Portions of the output:
Rule for 1940/1941:
[1940-01-01 - 1941-1231]; Delta: 01:00:00
DST start: Month: 2; Week: 1; Day: 25; DoW: Sunday; Time: 23:00; Fixed? True
DST end: Month: 10; Week: 1; Day: 6; DoW: Sunday; Time: 00:00; Fixed? True
Output with the fetched TimeZoneInfo:
Output with a TimeZoneInfo created from the rules returned by TimeZoneInfo.GetAdjustmentRules:
The latter output is correct for the rules returned - it's the rules that are wrong.
The transitions for Tunis should look like this:
1940-02-25 22:00:00Z +02:00:00 daylight CEST
1941-10-05 22:00:00Z +01:00:00 standard CET
So Tunis was in DST from 1940-02-25 until 1941-10-05 - DST *didn't end* in 1940, contrary to the rule.
I would suggest a test that looks through every system time zone and recreates it from itself with the rules it advertises, then checks the offset for, say, one day per week for all years 1900-2100. That would at least be a good smoke test.
Can confirm this is still broken for the latest rev on Ubuntu. I can't test this on Windows .NET Framework since it seems to not support any of the time zone IDs we support.