RE: F&O Question about extraction from negative date/duration va lues

> I've made the assumption that extracting from a negative 
> yearMonthDuration, dayTimeDuration, dateTime, and date 
> returns a negative 
> value (as opposed to the component's absolute value).  Is 
> that a correct 
> assumption?

I believe it's correct for durations but not for absolute dates and
dateTimes. In the latter case, I think the months value for a negative year
should still be positive, because it represents the number of months AFTER
the start of the year, so month 2 is later than month 1 regardless whether
the year is negative or positive. Only the year value should be signed.

You are quite right to point out that the spec needs to make a clear
statement on this.

Michael Kay

> 
> If it is, then there's a problem with the inclusive 
> statements 8.4.10 - 
> 8.4.12 (eg. "The hours value ranges from 0 to 23, inclusive").
> 
> If this assumption is not correct, then should there be a 
> is-positive function (or an equivalent statement) for these 
> datetypes?  
> 
> Cheers,
> Natalie
> 
> -- 
> Natalie Gordon, Software Engineer	  DecisionSoft Ltd.
> Telephone: +44 (0) 1865 203192		  
http://www.decisionsoft.com
Pathan Open Source XPath 2:		  http://software.decisionsoft.com

Received on Friday, 20 September 2002 11:53:14 UTC