SQL SWITCHOFFSET

The SQL SWITCHOFFSET is one of the Date and Time Function, which will convert the current time zone offset value to the specified time zone. The basic syntax of the SWITCHOFFSET in SQL Server is

SWITCHOFFSET (DateTimeOffset_Value, Time_Zone)

SQL SWITCHOFFSET Example

In this Date and Time Function example, we will show you how to use SWITCHOFFSET in SQL Server to change the time zone (offset value)

SELECT SYSDATETIMEOFFSET()	

SELECT SWITCHOFFSET(SYSDATETIMEOFFSET(), '-08:00')	

SELECT SWITCHOFFSET(SYSDATETIMEOFFSET(), '-04:00')
SQL SWITCHOFFSET Example
Categories SQL