Postgres 时间戳从 bigint 数据类型中提取日期


postgres timestamp extract date from bigint datatype

我使用 php 将日期(时间戳 unix 格式)插入到 postgres 表中。 下面是字段结构。

last_dwnld
(bigint)
-----------
1408788007
1408190322

字段数据类型为 bigint,其包含时间戳。字段名称为 last_dwnld。

请让我知道如何使用 Postgres 查询提取日期。last_dwnld::D ATE在这里没有帮助。

Postgres的内部to_timestamp函数处理这个问题(从8.1开始)

Select to_timestamp(1408788007); -- 2014-08-23 10:00:07+00