Re: Confirmation welcome, --31, --30, --29 and -02-29 oddities...

Hello Eric,

I'm not sure what was intended, but I would go for only those
dates that have the actual number. This would also be much closer
to what the ISO 8601, which says something like 'a day with
number 31' (i.e. only one day, underspecified, rather than
all days, throughout the ages).

Either way, it's not of much use, because there are very few things
that really work that way. The safest use for gDay is to store
a part of a date when you take it appart. But it's not a good
idea to take a date apart, because it's possible to translate
dates to other calendar systems for user display, whereas it's
not possible for something like gDay.

So the shortest summary is 'keep your hands away from it'.

Regards,    Martin.

At 17:33 01/10/28 +0100, Eric van der Vlist wrote:
>Knowing that:
>
>"3.2.13 gDay
>
>[Definition:]   gDay is a gregorian day that recurs, specifically a day
>of the month such as the 5th of the month. Arbitrary recurring days are
>not supported by this datatype. The $B%-(Bvalue space$B%-(B of gDay is the space
>of a set of calendar dates as defined in $B%!(B 3 of [ISO 8601].
>Specifically, it is a set of one-day long, monthly periodic instances."
>
>I assume that the algorithm defined in "E Adding durations to dateTimes" 
>is used to iterate over the different dates, including the rule about 
>"pinning":
>
>"Essentially, this calculation is equivalent to separating D into 
><year,month> and <day,hour,minute,second> fields. The <year,month> is 
>added to S. If the day is out of range, it is pinned to be within range. 
>Thus April 31 turns into April 30. Then the <day,hour,minute,second> is 
>added. This latter addition can cause the year and month to change."
>
>In other words, "--31" would iterate over Jan 31st, Feb 28th (or 29th 
>depending on the year), Mar 31th, Apr 30th, ...
>
>While this seems logical, I think that this should be better described in 
>the recommendation. The side effect is that if you look at the number of 
>days between two iterations for "--28", --29, 30 and "--31" you have (for 
>a non leap year):
>
>       Jan Feb Mar Apr May Jun
>--28    31  28  31  30  31
>--29    30  29  31  30  31
>--30    29  30  31  30  31
>--31    28  31  30  31  30
>
>IMO, this is not fully conform with the sentence "Specifically, it is a 
>set of one-day long, monthly periodic instances" since adding a month to 
>CCYY-02-28 should give CCYY-03-28 and that with my interpretation, the 
>result is kind of context dependent.
>
>The same effect happens for "-02-29"...
>
>Thanks
>
>Eric
>
>--
>Rendez-vous $B_(BParis pour le Forum XML.
>                     http://www.technoforum.fr/Pages/forumXML01/index.html
>------------------------------------------------------------------------
>Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
>http://xsltunit.org      http://4xt.org           http://examplotron.org
>------------------------------------------------------------------------
>

Received on Monday, 29 October 2001 23:03:16 UTC