sql utc to local time code example
Example 1: convert utc to est sql
select CONVERT(datetime, SWITCHOFFSET(dateTimeField, DATEPART(TZOFFSET,
dateTimeField AT TIME ZONE 'Eastern Standard Time')))
Example 2: sql server utc to local
SELECT
['TIME COLUM TO CONVERT'] AS [UTC_TIME],
DATEADD(hh, DATEDIFF(hh, GETUTCDATE(), GETDATE()),['TIME COLUM TO CONVERT']) AS [lOCAL_TIME]
FROM ['TABLE NAME']
Example 3: tsql utf to local time
select
[MyUtcDate] + getdate() - getutcdate()
from [dbo].[mytable]