Skip to content

Instantly share code, notes, and snippets.

@ashtewari
Created March 5, 2013 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashtewari/5091144 to your computer and use it in GitHub Desktop.
Save ashtewari/5091144 to your computer and use it in GitHub Desktop.
Unit test fails because TimeZoneInfo does not use the correct DST transitions.
/// <summary>
/// Is the specified datetime DST?
/// </summary>
[TestMethod]
public void DST_Started_On_April_27_1980()
{
var ts = new DateTime(1980, 4, 15, 12, 0, 0);
var isDst = Utils.EasternTimeZone.IsDaylightSavingTime(ts);
Assert.IsFalse(isDst);
}
internal static readonly TimeZoneInfo EasternTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment