Skip to main content

time function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 18 LTS 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.

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 to TIME.

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