make_time function
Applies to: Databricks SQL
Databricks Runtime 18.3 and above
Creates a time from hour, minute, and second fields.
Syntax
make_time(hour, minute, second)
Arguments
hour: An INTEGER expression evaluating to a value between 0 and 23.minute: An INTEGER expression evaluating to a value between 0 and 59.second: A numeric expression evaluating to a value between 0 and 59.999999.
Returns
A TIME.
If any of the arguments is NULL, the result is NULL. If any of the arguments is out of bounds, Databricks raises DATETIME_FIELD_OUT_OF_BOUNDS.
Common error conditions
Examples
SQL
> SELECT make_time(6, 30, 45.887);
06:30:45.887000
> SELECT make_time(23, 59, 59);
23:59:59
> SELECT make_time(NULL, 30, 0);
NULL
> SELECT make_time(25, 0, 0);
Error: DATETIME_FIELD_OUT_OF_BOUNDS