time function
Applies to: Databricks SQL
Databricks Runtime 18 LTS and above
nota
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.
Beta
This feature is in Beta.
Casts expr to TIME. This function is a synonym for CAST(expr AS TIME). For details, see cast function.
Syntax
time(expr)
Arguments
expr: Any expression that can be cast toTIME.
Returns
A TIME.
Examples
SQL
> SELECT time('10:30:00');
10:30:00
> SELECT time(TIMESTAMP'2026-10-29 16:45:30');
16:45:30