T-SQL also supports a function called AT TIME ZONE that can be used instead of both the SWITCHOFFSET and the TODATETIMEOFFSET functions, and that uses named time zones instead of offsets. Example select GETDATE() AT TIME ZONE 'Central America Standard Time' Here is a list of time zones in SQL Server select * from sys.time_zone_info
Great suggestion! Note that this was added in SQL Server 2016 - see it here: docs.microsoft.com/en-us/sql/t-sql/queries/at-time-zone-transact-sql?view=sql-server-ver15
the problem with AT TIME ZONE is that if you assign that result to a Variable or a Temp Table it will display the original time zone
T-SQL also supports a function called AT TIME ZONE that can be used instead of both the SWITCHOFFSET and the TODATETIMEOFFSET functions, and that uses named time zones instead of offsets.
Example select GETDATE() AT TIME ZONE 'Central America Standard Time'
Here is a list of time zones in SQL Server select * from sys.time_zone_info
Great suggestion! Note that this was added in SQL Server 2016 - see it here: docs.microsoft.com/en-us/sql/t-sql/queries/at-time-zone-transact-sql?view=sql-server-ver15