This article will show you how to create a custom TimeZoneInfo that incorporates AdjustmentRules for Daylight Saving Time (DST) Transitions all the way back to 1918. The backdrop for this effort is covered in my previous blog post: Beware of Daylight Saving Time Transitions in .NET. You might want to read that one first for the context.

As noted in the previous post, the System.TimeZoneInfo uses AdjustmentRules to account for DST Transitions, and the default AdjustmentRules do not incorporate all the available DST data. But it is possible to create a custom TimeZoneInfo and populate the AdjustmentRules with DST Transition data available to cover all DST transitions.

Read More…

Back in 1980, Daylight saving time (DST) started on April 27th. But calling the IsDaylightSavingTime method in System.TimeZoneInfo class for April 15, 1980 returns true. The following test fails:

  1. [TestMethod]
  2. public void DST_Started_On_April_27_1980()
  3. {
  4.     var ts = new DateTime(1980, 4, 15, 12, 0, 0);
  5.     var isDst = Utils.EasternTimeZone.IsDaylightSavingTime(ts);
  6.     Assert.IsFalse(isDst);
  7. }

Let’s do some sleuthing and get to the bottom of this.

Read More…