Re: Convert "epoch" to timestamp - Mailing list pgsql-general

From Thomas Lockhart
Subject Re: Convert "epoch" to timestamp
Date
Msg-id 3CC577F4.BFC60907@fourpalms.org
Whole thread Raw
In response to Convert "epoch" to timestamp  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
List pgsql-general
...
> Can I rely on this continuing to work?  Apparently
> not, because the docs say (wrt "abstime" and
> "reltime"): "Any or all of these internal types might
> disappear in a future release."

Right. But it won't disappear from the version you are running ;)

The following also works:

lockhart=# select timestamp without time zone 'today',
lockhart=> timestamp without time zone '1970-01-01'
lockhart=> + cast('1019520000' as interval);
      timestamp      |      ?column?
---------------------+---------------------
 2002-04-23 00:00:00 | 2002-04-23 00:00:00

I'm not sure what other features for integer->timestamp conversions may
be available in the future, but the above conforms to SQL9x standards so
is likely to be a good choice...

                     - Thomas

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Convert "epoch" to timestamp
Next
From: Tom Lane
Date:
Subject: Re: Convert "epoch" to timestamp