Re: Cast timestamptz to/from integer?

Поиск
Список
Период
Сортировка
От Chris Angelico
Тема Re: Cast timestamptz to/from integer?
Дата
Msg-id CAPTjJmrW-=jBM+zTxkhe81Wzy3d9mhGN7TsQcMxV7enbvpFHWA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Cast timestamptz to/from integer?  (Bartosz Dmytrak <bdmytrak@gmail.com>)
Ответы Re: Cast timestamptz to/from integer?
Список pgsql-general
On Tue, Apr 3, 2012 at 7:11 PM, Bartosz Dmytrak <bdmytrak@gmail.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Bartosz Dmytrak
Дата:
Сообщение: Re: Cast timestamptz to/from integer?
Следующее
От: Bartosz Dmytrak
Дата:
Сообщение: Re: Cast timestamptz to/from integer?