On Wed, 12 Feb 2003, Eugene van der Pijll wrote:

> > By the way, how do you know
> > what the standard requires if you haven't read it?  ;-)
>
> I trust you completely. Unfortunately, ISO 8601 isn't avaliable online,
> and none of the summaries I've read contain the expanded format.

You can get the final draft at http://www.pvv.ntnu.no/~nsaa/ISO8601.html

> > This implies that someone converting from an ISO 8601 format must
> > subtract one from the year if year <= 0 before feeding the value
> > into the DateTime constructor.
>
> Yes. Or they can use the parameter 'year_0'...
>
> Dave, you've provided the day_0, month_0, year_0 methods to get these
> values; perhaps one should also be able to use these as constructor
> parameters?

I this were done, it'd be as a different method.  One design goal I'm
really trying to stick to is to not offer different, mutually exclusive
parameters, or sets of parameters, to methods.

Right now the new() methods takes:

 year - required
 month, day, hour, minute, second - optional, with reasonable defaults
 language, time_zone - also optional

If I added year_0, month_0, and day_0, then I'd have to do things like
check if they user gave both year and year_0.  Too much room for error.

I'd consider a "new_0()" method, maybe.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to