Re: What's wrong with my date/interval arithmetic?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: What's wrong with my date/interval arithmetic?
Дата
Msg-id 23923.1078208721@sss.pgh.pa.us
обсуждение исходный текст
Ответ на What's wrong with my date/interval arithmetic?  (Wojtek <wojtg@polbox.com>)
Ответы Re: What's wrong with my date/interval arithmetic?  (Wojtek <wojtg@polbox.com>)
Strings in UDFs  ("Ryan Riehle" <rkr@buildways.com>)
Список pgsql-sql
Wojtek <wojtg@polbox.com> writes:
> Why is the "result" incorrect (off by one day)?
> When I do the exactly same arithmetic using timestamps created
> with to_timestamp, everything is OK ("expected_result").

It is not "exactly the same arithmetic", because to_timestamp
delivers a result of type timestamp-with-time-zone, whereas your
other values are evidently timestamp without time zone.  You did
not say what timezone setting you are using, but I think the
discrepancy is probably explained by that.
        regards, tom lane


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

Предыдущее
От: Wojtek
Дата:
Сообщение: What's wrong with my date/interval arithmetic?
Следующее
От: Wojtek
Дата:
Сообщение: Re: What's wrong with my date/interval arithmetic?