Re: Extracting date from epoche

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Richard Huxton" <dev(at)archonet(dot)com>
Cc: "pgsql" <pgsql-sql(at)postgresql(dot)org>, "Najm Hashmi" <najm(at)flipr(dot)com>
Subject: Re: Extracting date from epoche
Date: 2001-06-21 14:05:07
Message-ID: 13009.993132307@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Richard Huxton" <dev(at)archonet(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2001-06-21 14:28:29 Re: Using the extract() function in plpgsql
Previous Message DI Hasenöhrl 2001-06-21 11:13:11 Problem by inserting rows in a table via function