Link to home
Start Free TrialLog in
Avatar of minglelinch
minglelinch

asked on

Time zone time

My local machine is setin 'Eastern Standard Time' time zone. The value of serverTime DateTime variable is  assigned as "8/18/2014 4:10:30 PM". I have following code to convert 'Eastern Standard Time' to UTC time.

TimeZone ServerZone = TimeZone.CurrentTimeZone;
DateTime ServerUtcTime = ServerZone.ToUniversalTime(serverTime);

ServerUtcTime value is "8/18/2014 8:10:30 PM". My queation is that why ServerUtcTime value is not "8/18/2014 9:10:30 PM", as ''Eastern Standard Time" time Offset hours to UTC is -5, which means ''Eastern Standard Time" is 5 hours behind UTC. ServerUtcTime value should be "8/18/2014 9:10:30 PM", right? As those C# TimeZone functions already considered the summer saving time.

Or should I call some other function so that saving time will be counted in? I appreciate any help.
ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm confused.  UTC does not have Daylight Savings Time.  Only local time zones have that.  ??
Avatar of minglelinch
minglelinch

ASKER

Thanks