Re: BUG #1993: Adding/subtracting negative time intervals

Поиск
Список
Период
Сортировка
От Andrew - Supernews
Тема Re: BUG #1993: Adding/subtracting negative time intervals
Дата
Msg-id slrndluc99.g61.andrew+nonews@trinity.supernews.net
обсуждение исходный текст
Ответ на Re: BUG #1993: Adding/subtracting negative time intervals  (Klint Gore <kg@kgb.une.edu.au>)
Список pgsql-bugs
On 2005-10-26, Klint Gore <kg@kgb.une.edu.au> wrote:
> [sorry about the previous email, I quoted the wrong bit and clicked the
> wrong button]
>
> On Tue, 25 Oct 2005 23:41:54 -0400 (EDT), Bruce Momjian
><pgman@candle.pha.pa.us> wrote:
>>     test=> select
>>     test-> ('2005-10-30 13:22:00-05'::timestamptz -
>>     test(>  '2005-10-29 13:22:00-04'::timestamptz);
>>      ?column?
>>     ----------
>>      25:00:00
>>     (1 row)
>
> Is that actually the correct answer?

Absolutely.

> Disregarding daylight savings, there is 25hrs between them.  Once
> daylight savings is taken into account there should be 24 or 26 hours
> between them (southern/northern hemisphere respectively).
>
> Or have I missed something obvious?

Yes. The difference between those two times is exactly the same whatever
timezone the person running the query is in, because they are _completely
specified_ by the input. That difference is 25 hours. There are no
circumstances in which that difference could ever be 24 or 26 hours
regardless of what timezone the user is in. (The only way in which the
timezone makes a difference is that a user in US/Eastern might, under
some circumstances, wish to regard that time period as '1 day' rather
than 25 hours; no user in any other timezone would do so. Since the
conversion from '25 hours' to '1 day' loses information, it should not
happen.)

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services

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

Предыдущее
От: Andrew - Supernews
Дата:
Сообщение: Re: BUG #1993: Adding/subtracting negative time intervals
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #1993: Adding/subtracting negative time intervals