TIME
- TIME(hours, minutes, seconds)[source]
Constructs a time value from hour, minute, and second components.
The TIME function creates a valid time based on the provided hours, minutes, and seconds. It can operate element-wise if any of the inputs are arrays, producing a corresponding array of time values.
- Parameters:
- Return type:
- Returns:
A Formula object representing the constructed time. The result is an array if any input is an array; otherwise, it is a scalar. If the inputs do not form a valid time, the formula will evaluate to an error.
- Raises:
ValueError – If any of the inputs are not integers or integer arrays.
Examples
Basic usage:
TIME(14, 30, 0) # Returns a time representing 14:30:00
Using arrays:
TIME([9, 12, 15], [0, 30, 45], [0, 0, 30]) # Returns TIME_ARRAY with [09:00:00, 12:30:00, 15:45:30]
``hours`` — accepted types
INTEGER
INTEGER_ARRAY
``minutes`` — accepted types
INTEGER
INTEGER_ARRAY
``seconds`` — accepted types
INTEGER
INTEGER_ARRAY
Return types
TIME
TIME_ARRAY