Re: convert epoch to date - Mailing list pgsql-general

From Pavel Stehule
Subject Re: convert epoch to date
Date
Msg-id 162867790908301336y490978a2u823b70e1e8fcf379@mail.gmail.com
Whole thread Raw
In response to convert epoch to date  (Kevin Kempter <kevink@consistentstate.com>)
List pgsql-general
Hello

2009/8/30 Kevin Kempter <kevink@consistentstate.com>:
> Hi all;
>
> I know how to convert a date to an epoch:
>
> select extract ('epoch' from timestamp '2009-08-12')
>

postgres=# select extract ('epoch' from timestamp '2009-08-12');
 date_part
------------
 1250028000
(1 row)

Time: 0,734 ms
postgres=# select to_timestamp(1250028000);
      to_timestamp
------------------------
 2009-08-12 00:00:00+02
(1 row)

regards
Pavel Stehule

>
> How do I do the opposite, I want to convert epoch values to a date
>
>
> Thanks in advance
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Problem libpython2.3.so.1.0
Next
From: Jorge Godoy
Date:
Subject: Using WITH queries on VIEWs