second function

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

Returns the second component of the timestamp in expr.

Syntax

second(expr)

Arguments

  • expr: A TIMESTAMP expression.

Returns

An INTEGER.

This function is equivalent to int(extract(SECOND FROM timestamp)).

Examples

> SELECT second('2009-07-30 12:58:59');
 59