DATETIMEOFFSETFROMPARTS#
Returns a datetimeoffset value for the specified date and time, with the specified offsets and precision.
Syntax#
DATETIMEOFFSETFROMPARTS ( year, month, day, hour, minute, seconds, fractions, hour_offset, minute_offset, precision )
Arguments#
year, month, day, hour, minute, seconds
Integer expressions specifying the date and time parts.
fractions
Integer expression specifying fractions of a second, in units of precision.
hour_offset, minute_offset
Integer expressions specifying the hour and minute portions of the time zone offset.
precision
Integer literal from 0 to 7 specifying the precision of the datetimeoffset value to be returned.
Return types#
datetimeoffset( _precision_ )
Example#
SELECT DATETIMEOFFSETFROMPARTS(2026, 7, 13, 12, 0, 0, 5, 2, 0, 1);
-- Result: 2026-07-13 12:00:00.5 +02:00