Re: [GENERAL] conversion from epoch

2012-07-30 Thread Adrian Klaver

On 07/30/2012 07:36 AM, Little, Douglas wrote:

I have an input source that is in epoch time.Is there a built-in
conversion to changing to timestamp


http://www.postgresql.org/docs/9.1/interactive/functions-formatting.html
"
to_timestamp(double precision)	timestamp with time zone	convert Unix 
epoch to time stamp	to_timestamp(1284352323)

"

So:

test=> SELECT to_timestamp(extract(epoch from now()));
 to_timestamp
---
 2012-07-30 15:51:42.587106-07




Thanks

*Doug Little*




--
Adrian Klaver
adrian.kla...@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] conversion from epoch

2012-07-30 Thread Steve Atkins

On Jul 30, 2012, at 7:36 AM, Little, Douglas wrote:

> I have an input source that is in epoch time.Is there a built-in 
> conversion to changing to timestamp

to_timestamp().

You can also do things like "select timestamptz 'epoch' + ? * interval '1 
second'".

Cheers,
  Steve


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] conversion from epoch

2012-07-30 Thread Andreas Kretschmer




"Little, Douglas"  hat am 30. Juli 2012 um 16:36
geschrieben:


> I have an input source that is in epoch time.Is there a built-in
> conversion to changing to timestamp
> 
> 
> 
select 'epoch'::date +  * '1second'::interval;




Andreas

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] conversion from epoch

2012-07-30 Thread Little, Douglas
I have an input source that is in epoch time.Is there a built-in conversion 
to changing to timestamp

Thanks


Doug Little

Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz 
Worldwide
500 W. Madison, Suite 1000  Chicago IL 60661| Office 312.260.2588 | Fax 
312.894.5164 | Cell 847-997-5741
douglas.lit...@orbitz.com
 [cid:image001.jpg@01CD6E36.D9E7D130]   orbitz.com | 
ebookers.com | 
hotelclub.com | 
cheaptickets.com | 
ratestogo.com | 
asiahotels.com

<>