W
Wayne
An interesting problem has arisen concerning the new Windows DST patches.
The rules seem to apply without regard to year. For example, run the
following C# code (assume you're running in the US Eastern time zone):
DateTime d = new DateTime(2006, 11, 1);
Console.WriteLine(d.ToString("dd MMM yyyy hh:mm tt zzz ") + " " +
d.IsDaylightSavingTime());
DateTime d2 = new DateTime(2007, 11, 1);
Console.WriteLine(d2.ToString("dd MMM yyyy hh:mm tt zzz ") + " " +
d2.IsDaylightSavingTime());
If the DST patch has been applied, you will get the following output:
01 Nov 2006 12:00 AM -04:00 True
01 Nov 2007 12:00 AM -04:00 True
The result for 1 Nov 2006 is incorrect -- it was not DST, but it would have
been had the new rules been in effect.
It appears that if the DST patch is applied, then for past years there is a
two week period in March/April, and a one week period in October/November
when IsDaylightSavingTime() will be incorrect, since during those periods
the new rules will yield incorrect results.
Does anyone know if Microsoft has any guidance for handling these anomalies?
Will there be another patch?
Wayne
The rules seem to apply without regard to year. For example, run the
following C# code (assume you're running in the US Eastern time zone):
DateTime d = new DateTime(2006, 11, 1);
Console.WriteLine(d.ToString("dd MMM yyyy hh:mm tt zzz ") + " " +
d.IsDaylightSavingTime());
DateTime d2 = new DateTime(2007, 11, 1);
Console.WriteLine(d2.ToString("dd MMM yyyy hh:mm tt zzz ") + " " +
d2.IsDaylightSavingTime());
If the DST patch has been applied, you will get the following output:
01 Nov 2006 12:00 AM -04:00 True
01 Nov 2007 12:00 AM -04:00 True
The result for 1 Nov 2006 is incorrect -- it was not DST, but it would have
been had the new rules been in effect.
It appears that if the DST patch is applied, then for past years there is a
two week period in March/April, and a one week period in October/November
when IsDaylightSavingTime() will be incorrect, since during those periods
the new rules will yield incorrect results.
Does anyone know if Microsoft has any guidance for handling these anomalies?
Will there be another patch?
Wayne