make_time function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 18 and above

Note

Databricks Runtime 18 is newer than Databricks Runtime 18.0, 18.1, and 18.2. Features that would previously have shipped as a later numbered version now ship as dated updates to Databricks Runtime 18 instead. For details, see About unified release notes.

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, Azure Databricks raises DATETIME_FIELD_OUT_OF_BOUNDS.

Common error conditions

Examples

> 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