TODATETIMEOFFSET
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.