DST bug 2007
I use "daylight.start" and "daylight.end" to get the start and end dates for DST. I just patched my XP system with KB928388 which contains the fixes for the new DST. Now the dates are correct for 2007 and greater, but wrong for years < 2007. If you use year = 2006 you get 3/12/2006 and 11/5/2006. hey shold be 4/2/2006 and 10/29/2006.
Has anyone else run into this?
Thanks,
ttfo
Answers
Thanks for the reply. I was afraid of that. If I understand the ms724253.aspx this feature will be available with vista, correct?
Thanks.
You can see similar issues in IsDaylightSavingsTime. All of the below return based on the 2007 rules rather than the way the various years actually implemented Daylight Savings Time.
using
System;using System.Collections.Generic;
using
System.Text;namespace
ConsoleApplication1{
class Program{
static void Main(string[] args){
DateTime date0 = new DateTime(1980, 3, 1); Console.WriteLine(date0.IsDaylightSavingTime()); DateTime date1 = new DateTime(1980, 3, 31); Console.WriteLine(date1.IsDaylightSavingTime()); DateTime date2 = new DateTime(1980, 4, 15); Console.WriteLine(date2.IsDaylightSavingTime()); DateTime date3 = new DateTime(1990, 3, 31); Console.WriteLine(date3.IsDaylightSavingTime()); DateTime date4 = new DateTime(1990, 4, 15); Console.WriteLine(date4.IsDaylightSavingTime()); DateTime date5 = new DateTime(2007, 3, 31); Console.WriteLine(date5.IsDaylightSavingTime()); DateTime date6 = new DateTime(2007, 4, 15); Console.WriteLine(date6.IsDaylightSavingTime()); Console.ReadLine();}
}
}
All Replies
- All versions of Windows prior to Vista only support one set of rules per timezone so it doesn't matter what year you select, XP will always use the latest rules. Check out http://msdn2.microsoft.com/en-us/library/ms724253.aspx for info on "dynamic" time zones in Vista.
Thanks for the reply. I was afraid of that. If I understand the ms724253.aspx this feature will be available with vista, correct?
Thanks.
You can see similar issues in IsDaylightSavingsTime. All of the below return based on the 2007 rules rather than the way the various years actually implemented Daylight Savings Time.
using
System;using System.Collections.Generic;
using
System.Text;namespace
ConsoleApplication1{
class Program{
static void Main(string[] args){
DateTime date0 = new DateTime(1980, 3, 1); Console.WriteLine(date0.IsDaylightSavingTime()); DateTime date1 = new DateTime(1980, 3, 31); Console.WriteLine(date1.IsDaylightSavingTime()); DateTime date2 = new DateTime(1980, 4, 15); Console.WriteLine(date2.IsDaylightSavingTime()); DateTime date3 = new DateTime(1990, 3, 31); Console.WriteLine(date3.IsDaylightSavingTime()); DateTime date4 = new DateTime(1990, 4, 15); Console.WriteLine(date4.IsDaylightSavingTime()); DateTime date5 = new DateTime(2007, 3, 31); Console.WriteLine(date5.IsDaylightSavingTime()); DateTime date6 = new DateTime(2007, 4, 15); Console.WriteLine(date6.IsDaylightSavingTime()); Console.ReadLine();}
}
}

