How do I convert UTC time to local time in SQL?
How do I convert UTC time to local time in SQL? SELECT CONVERT(datetime, SWITCHOFFSET(CONVERT(DATETIMEOFFSET, GETUTCDATE()), DATENAME(TZOFFSET, SYSDATETIMEOFFSET()))) AS LOCAL_IST; Here, the GETUTCDATE() function can be used to get the current date and time UTC. Using this query the UTC gets converted to local IST. How do I get the UTC DateTime in SQL Server? GETUTCDATE() […]