2016-04-21 303 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