TSQL: How to convert local time to UTC? (SQL Server 2008)

This works for dates that currently have the same UTC offset as SQL Server’s host; it doesn’t account for daylight savings changes. Replace YOUR_DATE with the local date to convert.

SELECT DATEADD(second, DATEDIFF(second, GETDATE(), GETUTCDATE()), YOUR_DATE);

Leave a Comment