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.