Re: unexpected behavior in combining timestamps with times zone and intervals

Поиск
Список
Период
Сортировка
От Niklas Johansson
Тема Re: unexpected behavior in combining timestamps with times zone and intervals
Дата
Msg-id 7F091D58-8B83-4F23-80B7-96D5E81EE2A9@tele2.se
обсуждение исходный текст
Ответ на unexpected behavior in combining timestamps with times zone and intervals  (Charles Seaton <cseaton@stccmop.org>)
Ответы Re: unexpected behavior in combining timestamps with times zone and intervals
Список pgsql-general
On 3 nov 2007, at 12.26, Charles Seaton wrote:
> select ('12/31/2006 UTC'::timestamptz + '307 days 02:45:30'::interval)
> However, this gives an incorrect result (off by 1 hour)
> "2007-11-02 18:45:30-07"

Have you checked your servers TimeZone setting? Also, which Postgres
version are you running? I get the following from 8.2.5, which seems
to be correct:

test=# select ('2006-12-31 UTC'::timestamptz + '307 days
02:45:30'::interval) AT TIME ZONE 'MST';
       timezone
---------------------
2007-11-02 19:45:30

(I have a different DateStyle setting, so I had to change the input
format. I also added the 'AT TIME ZONE' statement, since my server's
in another time zone.)




Sincerely,

Niklas Johansson





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

Предыдущее
От: Charles Seaton
Дата:
Сообщение: unexpected behavior in combining timestamps with times zone and intervals
Следующее
От: Robert Treat
Дата:
Сообщение: Re: young guy wanting (Postgres DBA) ammo