TSQL: How to convert local time to UTC? (SQL Server 2008)
sql-server, sql-server-2008, t-sql, timezone, utc
Solution
7 years passed and... actually there's this new SQL Server 2016 feature that does exactly what you need. It is called AT TIME ZONE and it converts date to a specified time zone considering DST (daylight saving time) changes. More info here: https://msdn.microsoft.com/en-us/library/mt612795.aspx
Problem
We are dealing with an application that needs to handle global time data from different time zones and daylight savings time settings. The idea is to store everything in UTC format internally and only convert back and forth for the localized user interfaces. Does the SQL Server offer any mechanisms for dealing with the translations given a time, a country and a timezone? This must be a common problem, so I'm surprised google wouldn't turn up anything usable. Any pointers?