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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top