Input timestamp from epoch?

From: Bill Moseley <moseley(at)hank(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Input timestamp from epoch?
Date: 2005-08-19 07:27:40
Message-ID: 20050819072740.GA16302@hank.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)hank(dot)org

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sean Utt 2005-08-19 07:46:29 Re: BUG #1830: Non-super-user must be able to copy from a file
Previous Message Bernard 2005-08-19 07:21:15 Re: [GENERAL] BUG #1830: Non-super-user must be able to copy from a