Hour Procedure

Returns the hour component of a time.

Overload #1: Hour(dateTime)

Declaration
function Hour(dateTime as DateTime) as Number

Parameters

Return value

Number — The hour component of the time.

Example

Code
dim x = DateTimeFromParts(2021, 3, 12, 14, 30, 59, 488)
print Hour(x)
Output
14

Overload #2: Hour(dateTimeOffset)

Declaration
function Hour(dateTimeOffset as DateTimeOffset) as Number

Parameters

Return value

Number — The hour component of the time.

Example

Code
dim x = DateTimeOffsetFromParts(2021, 3, 12, 4, 30, 59, 488, Hours(-4))
print Hour(x)
Output
14