Re: Extracting date from epoche - Mailing list pgsql-sql

From Tom Lane
Subject Re: Extracting date from epoche
Date
Msg-id 13009.993132307@sss.pgh.pa.us
Whole thread Raw
In response to Re: Extracting date from epoche  ("Richard Huxton" <dev@archonet.com>)
List pgsql-sql
"Richard Huxton" <dev@archonet.com> writes:
> Tom - I thought 'epoch'::timestamp should work too - good reason, or just
> One Of Those Things (tm)?

It works --- it's a symbolic value, though.

regression=# select 'epoch'::timestamp;?column?
----------epoch
(1 row)

regression=# select 'epoch'::timestamp + ('1 day'::interval);       ?column?
------------------------1970-01-01 19:00:00-05
(1 row)

Note the epoch is midnight GMT = 7pm local time here.
        regards, tom lane


pgsql-sql by date:

Previous
From: DI Hasenöhrl
Date:
Subject: Problem by inserting rows in a table via function
Next
From: "Richard Huxton"
Date:
Subject: Re: Using the extract() function in plpgsql