Re: Cast timestamptz to/from integer?

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Cast timestamptz to/from integer?
Date: 2012-04-03 09:13:52
Message-ID: CAPTjJmrW-=jBM+zTxkhe81Wzy3d9mhGN7TsQcMxV7enbvpFHWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 3, 2012 at 7:11 PM, Bartosz Dmytrak <bdmytrak(at)gmail(dot)com> wrote:
> I think You can use epoch
> there is an
> example: http://www.postgresql.org/docs/9.1/static/functions-datetime.html
>
>
> SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 982384720.12 * INTERVAL '1
> second';

Yep, but when you do that a lot, your statement gets extremely long. I
can create a function that'll hide the mess away, but what I'm hoping
to do is simply cast:

SELECT 982384720::timestamptz;

ChrisA

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bartosz Dmytrak 2012-04-03 09:26:11 Re: Cast timestamptz to/from integer?
Previous Message Bartosz Dmytrak 2012-04-03 09:11:35 Re: Cast timestamptz to/from integer?