Skip to main content

now function

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

Returns the current timestamp at the start of query evaluation.

This function is a synonym for current_timestamp.

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​

now( [ 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).

Examples​

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

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