SWITCHOFFSET Date Function TSQL Tutorial

SWITCHOFFSET is an date function and returns a datetimeoffset value that is changed from the stored time zone offset.

SWITCHOFFSET Syntax:

SWITCHOFFSET( DATETIMEOFFSET, timezone )

SWITCHOFFSET Example:

select switchoffset (CONVERT(datetimeoffset, GETDATE()), '-03:00') AS Result_1,
switchoffset (CONVERT(datetimeoffset, GETDATE()), '+03:00') AS Result_2;

Result_1Result_2
2014-03-01 13:07:18.3270000 -03:002014-03-01 19:07:18.3270000 +03:00