HOUR
- HOUR(time)[source]
Extracts the hour component from a time or array of times.
The HOUR function returns the hour from the provided time. It supports both single times and arrays of times, returning an integer or an integer array accordingly.
- Parameters:
time (
Operand) – The time or array of times from which to extract the hour.- Return type:
- Returns:
The hour as an integer or array of integers.
- Raises:
ValueError – If the input is not a time type.
Examples
HOUR(TIME(14, 32, 53)) # Returns 14
``value`` — accepted types
DATETIME
DATETIME_ARRAY
TIME
TIME_ARRAY
Return types
INTEGER
INTEGER_ARRAY