数据仓库服务 GAUSSDB(DWS)-时间/日期函数:unix_timestamp([timestamp with time zone])

时间:2024-01-26 16:15:18

unix_timestamp([timestamp with time zone])

描述:获取从'1970-01-01 00:00:00'UTC到入参时间经历的秒数。无入参时,指定为当前时间。

返回值类型:bigint(无入参)/numeric(有入参)

示例:

1
2
3
4
5
SELECT unix_timestamp();
 unix_timestamp
----------------
     1693906219
(1 row)
1
2
3
4
5
SELECT unix_timestamp('2018-09-08 12:11:13+06');
 unix_timestamp
----------------
     1536387073.000000
(1 row)
support.huaweicloud.com/sqlreference-820-dws/dws_06_0309.html
推荐文章