Time zone time
Posted on 2014-08-18
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.