Re: Broken(?) 'interval' problems. [Was: ISO 8601 "Time Intervals"]

From: "Ron Mayer" <ron(at)intervideo(dot)com>
To: "Bruno Wolff III" <bruno(at)wolff(dot)to>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Broken(?) 'interval' problems. [Was: ISO 8601 "Time Intervals"]
Date: 2003-09-11 01:15:43
Message-ID: POEDIPIPKGJJLDNIEMBEKEFKDJAA.ron@intervideo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Bruno wrote:
> ...An interval has two parts... the number of months...and...the number of
> seconds...if both parts are nonzero it makes a difference in which part
> gets added first. For example '2003-02-28'::date + '1 month 1 day'::interval
> might be either 2003-03-29 or 2003-04-01. In 7.4 it is currently 2003-03-29,

Ah.. I understand.

At least one other application that does date math, MSFT Excel
also claims 2003-03-29 when I use the expression
"=DATE(YEAR(B3),MONTH(B3)+1,DAY(B3)+1)"
so I think that's a reasonable rule to keep.

Anyone, please let me know if there are good reasons such as
standards or other major applications that behave otherwise.

Thanks for this other interesting case that I need to worry about!

And yes, I'll document it as well. :-)

Ron

PS: I'm not receiving some emails I send to hackers. If you
need a timely answer please cc me -- though I will follow
the thread on archives as well to catch anything I miss.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2003-09-11 02:15:30 Re: massive quotes?
Previous Message Philip Yarra 2003-09-11 00:56:20 Re: Unixware Patch (Was: Re: Beta2 Tag'd and Bundled ...)