System.Globalization.DaylightTime not working

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hoping someone can help.

System.Globalization.DaylightTime dt =
TimeZone.CurrentTimeZone.GetDaylightChanges(2005);
DateTime sd = dt.Start;
DateTime ed = dt.End;

When I run this piece of code, sd and ed both = '1/1/1'

Thanks in advance,

Mike
 
Mike,

Here's the dreaded "works for me" answer. I get the correct values.

I assume you've already checked your test machine's time settings?

- Mike
 
Not all time zones use daylight savings time. In these time zones the
GetDaylightChanges method returns with it's Start and End properties set
to DateTime.MinValue, which is exactly what you are experiencing.

Regards,
Joakim
 
Back
Top