Search Postgresql Archives

Input timestamp from epoch?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm entering data into a Postgresql database where the input dates are
currently in unix epoch values.  Is there a way for Postgresql to
parse that epoch into a "timestamp(0) with time zone"?

I read section 8.5 "Date/Time Types" and I can see I can input an
(well THE) epoch, and I can EXTRACT(EPOCH FROM [timestamp]), but I'm
not seeing where I can use an epoch format as input for a timestamp(0)
with time zone.


I'm not convinced that I want to store the value as a timestamp.  My
time values are all within the epoch range, so that's not an issue.
Then represent a point in time (and event), and I need to display them
in various timezones (depending on where the event is happening).
And the epoch is reasonably easy to work with.  I guess a timestamp(0)
with time zone is basically the same thing -- but gives me date
operations on Postgresql.  Probably faster for my client application
to parse epoch from the database, though.


-- 
Bill Moseley
moseley@xxxxxxxx


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux