Skip to main content

current_time function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 18.3 and above

Returns the current time at the start of query evaluation. All calls of current_time within the same query return the same value.

Syntax

current_time( [ precision ] )

Arguments

  • precision: An optional INTEGER literal in the range 0 to 6, indicating how many fractional digits of seconds to include. The default is 6.

Returns

A TIME.

The parentheses are optional when no precision argument is given.

Examples

SQL
> SELECT current_time();
16:57:04.304361

> SELECT current_time;
16:57:04.304361

> SELECT current_time(0);
16:57:04

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