2016-04-21 302 views
0

我使用php将日期(timestamp unix格式)插入到postgres表中。下面是场结构。postgres timestamp从bigint数据类型中提取日期

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

字段数据类型为BIGINT及其包含时间戳。字段名称是last_dwnld。

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

+0

考虑该列转换为时间戳列。 –

回答

1

Postgres的内部TO_TIMESTAMP函数处理这个(自8.1)

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