Re: converting epoch to timestamp - Mailing list pgsql-sql

From Stef
Subject Re: converting epoch to timestamp
Date
Msg-id 20051026113142.25ec9045@svb.ucs.co.za
Whole thread Raw
In response to converting epoch to timestamp  (Rajesh Kumar Mallah <mallah.rajesh@gmail.com>)
Responses SETOF RECORD RETURN VALUE
List pgsql-sql
Rajesh Kumar Mallah mentioned :
=> Can anyone tell me how to convert epoch to timestamp ?
=> 
=> ie reverse of :
=> 
=> SELECT EXTRACT( epoch FROM  now() );
=> +------------------+
=> |    date_part     |
=> +------------------+
=> | 1130317518.61997 |
=> +------------------+

Here is one way (In my case I still had to add/subtract timezone diff)
select '19700101'::timestamp + foo.epoch::interval from (select extract(epoch from now())||' seconds' as epoch) foo ;


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: converting epoch to timestamp
Next
From: "Marc G. Fournier"
Date:
Subject: Re: pl/* overhead ...