From: Stef <svb@ucs.co.za>
To: Rajesh Kumar Mallah <mallah.rajesh@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: converting epoch to timestamp
Date: Wed, 26 Oct 2005 11:31:42 +0200
Message-ID: <20051026113142.25ec9045@svb.ucs.co.za> (raw)
In-Reply-To: <a97c77030510260205n246dcec7rad2818eee629c15@mail.gmail.com>
References: <a97c77030510260205n246dcec7rad2818eee629c15@mail.gmail.com>
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 ;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: svb@ucs.co.za, mallah.rajesh@gmail.com
Subject: Re: converting epoch to timestamp
In-Reply-To: <20051026113142.25ec9045@svb.ucs.co.za>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox