Re: conversion from epoch - Mailing list pgsql-general

From Adrian Klaver
Subject Re: conversion from epoch
Date
Msg-id 5017102A.5000505@gmail.com
Whole thread Raw
In response to conversion from epoch  ("Little, Douglas" <DOUGLAS.LITTLE@orbitz.com>)
List 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.klaver@gmail.com

pgsql-general by date:

Previous
From: Vincent Veyron
Date:
Subject: Re: Debian upgrade with PostgreSQL
Next
From: Ondrej Ivanič
Date:
Subject: new material for "Postgres for MySQL users" presentation