views:

45

answers:

1

Hi, for some reason when I use the following code

 TimeSpan timeDiffUtcServer = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);

it returns -07:00:00 offset

I am using Windows XP and my timezone is set to Pacific time -08:00. I am running this through VS 2010's built in IIS server which is on my computer, so I can't figure out why the discrepancy in time.

Thanks!

+4  A: 

Pacific Daylight Time has an offset of -7 hours.

Greg Hewgill
Dang, I had no idea that checking the Daylight savings time adjusted the timezone offset. Thanks for the help!
chobo