SQL Flow Field Guide

TODATETIMEOFFSET

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. The fractional precision is the same as the datetime_expression argument.

Syntax at a glance

TODATETIMEOFFSET ( datetime_expression , timezoneoffset_expression )

Work example

Attach a numeric offset to a datetime expression without changing clock fields.

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

Check your work Use it only when the input clock time is known to belong to that offset.

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