Handling time zones and daylight savings time in .NET and SQL Server 08R2+

Posted on 2012-09-18
Last Modified: 2012-10-09
Hi Experts,

     Is there a standard way to handle (record/display/report) time sensitive data that is generated accross time zones and daylight savings time?  We're in a .NET and SQL Server 08R2+ environment!  

I am seeing things about recording all time stamps in UTC time and then adding the TZoffset to it and using a lookup table (ISO-3166 country code) to account for the DST on top of the time zone calculation!  Is this the "correct" or "standard" way of doing it?

Also, I am seeing built in functionality in SQL to calculate local time from UTC

dateadd(minute, datepart(TZoffset, sysdatetimeoffset()), @InputUtcDateTime)

but is there anything built in to handle DST as well?

Question by:axnst2
    LVL 96

    Accepted Solution

    SQL Server 2008 has new elements for time zone adjustment, as described here:

    Using time zone data in SQL Server 2008

    Author Closing Comment

    Thanks!  That's a big help!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    734 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

    22 Experts available now in Live!

    Get 1:1 Help Now