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

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.