From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | "Little, Douglas" <DOUGLAS(dot)LITTLE(at)orbitz(dot)com> |
Cc: | "PostgreSQL General (pgsql-general(at)postgresql(dot)org)" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: conversion from epoch |
Date: | 2012-07-30 22:52:26 |
Message-ID: | 5017102A.5000505@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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(dot)klaver(at)gmail(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Ondrej Ivanič | 2012-07-30 23:27:54 | new material for "Postgres for MySQL users" presentation |
Previous Message | Vincent Veyron | 2012-07-30 19:58:38 | Re: Debian upgrade with PostgreSQL |