DateTimeOffsetFromParts Procedure

Creates a DateTimeOffset for the specified year, month, day, hour, minute, second, millisecond, and UTC offset.
Declaration
function DateTimeOffsetFromParts(
year as Number, month as Number, day as Number,
hour as Number, minute as Number, second as Number,
millisecond as Number, utcOffset as TimeSpan
) as DateTimeOffset

Parameters

Return value

DateTimeOffset — A new DateTimeOffset.

Example

Code
dim x = DateTimeOffsetFromParts(2021, 3, 12, 4, 30, 0, 0, Hours(-6))
print x.DateTime
print TotalHours(x.Offset)
Output
2021-03-12 04:30:00.000
-6