current_timestamp function
Applies to: Databricks SQL
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 optionalINTEGERliteral. Valid values are6,7,8, and9. The default is6.
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