unix_seconds 函数

适用于:check marked yes Databricks SQL check marked yes Databricks Runtime

返回自 1970-01-01 00:00:00 UTC 以来经过的秒数。

语法

unix_seconds(expr)

参数

  • expr:时间戳表达式。

返回

一个 BIGINT。

此函数会截断更高级别的精度。

示例

> SELECT unix_seconds(TIMESTAMP('1970-01-01 00:00:01Z'));
 1