Time zone time

Posted on 2014-08-18
Last Modified: 2014-08-19
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.
Question by:minglelinch
    LVL 35

    Accepted Solution

    Yes , the method considers day light saving rule.
    You could use DateTime.ToUniversalTime
    LVL 82

    Expert Comment

    by:Dave Baldwin
    I'm confused.  UTC does not have Daylight Savings Time.  Only local time zones have that.  ??
    LVL 1

    Author Closing Comment


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Article by: Ivo
    Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now