0
votes

I inserted date (timestamp unix format) into postgres table using php. here below is the field structure.

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

Field data type is bigint and its contain timestamp. field name is last_dwnld.

please let me know how to extract date using postgres query. last_dwnld::DATE is not helping here.

1
Consider converting that column to a timestamp column. - Dan H

1 Answers

1
votes

Postgres's internal to_timestamp function handles this (since 8.1)

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