SQL Flow Field Guide

DATETIMEOFFSETFROMPARTS

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( precision )

Syntax at a glance

DATETIMEOFFSETFROMPARTS ( year, month, day, hour, minute, seconds, fractions, hour_offset, minute_offset, precision )

Work example

Build a datetimeoffset value from date, time, precision, and offset parts.

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

Check your work Validate offset range and fractional precision because an offset is not a named time zone.

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