SQL Flow Field Guide

SWITCHOFFSET

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

date/time arithmetic, parts, construction or truncation

What changes

Input
date/time arguments
Output or change
date/time or integer value
Return type
datetimeoffset with the fractional precision of the datetimeoffset_expression argument.

Syntax at a glance

SWITCHOFFSET ( datetimeoffset_expression , timezoneoffset_expression )

Work example

Display the same datetimeoffset instant with another numeric offset.

Test month end, leap day, offset, and the session language that will run the query.

Check your work Use a valid offset and do not treat this as named daylight-saving conversion.

Open Microsoft Learn for full syntax, permissions, and details for your version.