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.
C#

Avatar of undefined
Last Comment
minglelinch

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Miguel Oz

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dave Baldwin

I'm confused.  UTC does not have Daylight Savings Time.  Only local time zones have that.  ??
minglelinch

ASKER
Thanks
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy