Handling time zones and daylight savings time in .NET and SQL Server 08R2+
Posted on 2012-09-18
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?