localtime 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.

Important

This feature is in Beta.

Returns the current time at the start of query evaluation. The value does not change during the query.

This function is a synonym for current_time.

Syntax

localtime( [ precision ] )

Arguments

  • precision: An optional INTEGER literal from 0 through 9 that specifies the number of fractional-second digits. The default is 6.

Returns

A TIME.

The parentheses are optional when you omit precision.

Examples

> SELECT localtime();
  16:57:04.304361

> SELECT localtime(3);
  16:57:04.304