Hour Procedure
Returns the hour component of a time.
Overload #1: Hour(dateTime)
Declaration
function Hour(dateTime as DateTime) as Number
Parameters
- dateTime as DateTime — The time to extract the hour component from.
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
Overload #2: Hour(dateTimeOffset)
Declaration
function Hour(dateTimeOffset as DateTimeOffset) as Number
Parameters
- dateTimeOffset as DateTimeOffset — The time to extract the hour component from.
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