Skip to main content

current_timestamp function

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

Returns the current timestamp at the start of query evaluation.

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

Syntax​

current_timestamp( [ precision ] )

Arguments​

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

Returns​

A TIMESTAMP_LTZ(precision). If you omit precision, the result is a TIMESTAMP_LTZ(6).

The parentheses are optional when you omit precision.

Examples​

SQL
> SELECT current_timestamp();
2020-04-25 15:49:11.914
> SELECT current_timestamp;
2020-04-25 15:49:11.914

> SELECT current_timestamp(9);
2020-04-25 15:49:11.914123456