Pular para o conteúdo principal

localtimestamp function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

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

Beta

The precision argument is available only in Databricks Runtime 19 and above. Values 7 through 9 are in Beta. For nanosecond-precision support, see TIMESTAMP_NTZ type.

Syntax​

localtimestamp( [ precision ] )

Arguments​

  • precision: An optional INTEGER literal. Valid values are 6, 7, 8, and 9. The default is 6.

Returns​

A TIMESTAMP_NTZ with the specified precision.

The parentheses are optional when you omit precision.

Examples​

SQL
> SELECT localtimestamp();
2026-10-29 16:57:04.304361

> SELECT localtimestamp(9);
2026-10-29 16:57:04.304361123