Re: DateTime, the year 0, and ISO8601

2003-02-14 Thread Dave Rolsky
On Fri, 14 Feb 2003, Matthew Simon Cavalletto wrote: However, using classes enables inheritance and other useful programming techniques, and there's a lot to be said for that. Good point. Hmm. It seems like we can get the best of both worlds if we simply allow these functions to be called

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Eugene van der Pijll
Peter J. Acklam schreef: Why no year 0 in DateTime? I was surprised to see the following in the synopsis: $year = $dt-year; # there is no year 0 The ISO8601 range is [,], thus including year 0. The standard even explicitly mentions that year 0 was a leap year.

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Peter J. Acklam
Eugene van der Pijll [EMAIL PROTECTED] wrote: ISO8601 obviously uses the astronomical convention. Dave evidently uses the Dionysian reckoning. I think this is the correct choice: if I want to create a date in 44BC, I'd prefer to say $dt = DateTime-new( year = -44, month = 3, day =

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Peter J. Acklam
Dave Rolsky [EMAIL PROTECTED] wrote: On Wed, 12 Feb 2003, Eugene van der Pijll wrote: Interestingly, the function ymd (and therefore also iso8601) uses astronomical years. Obviously correct for iso8601; I'm not sure about ymd. That's a bug. So is the output of the iso8601 method when

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Rick Measham
At 8:49 PM +0100 12/2/03, Eugene van der Pijll wrote: On your other point: I think it would be nice if DateTime::new would accept years like '1974AD', '44BC, '2003CE' and '753BCE'. But most people would say the year -753 meant 753 BC, so I would keep that definition. I would agree. However, the

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Peter J. Acklam
[EMAIL PROTECTED] (Dave Rolsky) wrote: On Wed, 12 Feb 2003, Peter J. Acklam wrote: Alas, the current API is a bastard -- an odd mixture of the two and doesn't match *any* convention: It doesn't match the 44 BC- type notation since you have to use a leading - rather than the trailing BC,

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Peter J. Acklam
[EMAIL PROTECTED] (Eugene Van Der Pijll) wrote: Peter J. Acklam schreef: The code my $dt = DateTime-new( year = -7 ); print $dt-iso8601(), \n; prints -006-01-01T00:00:00 but ISO 8601 requires at least four digits in the year. No. I haven't read ISO 8601,

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Dave Rolsky
On Wed, 12 Feb 2003, Peter J. Acklam wrote: On your other point: I think it would be nice if DateTime::new would accept years like '1974AD', '44BC, '2003CE' and '753BCE'. But most people would say the year -753 meant 753 BC, so I would keep that definition. This implies that someone

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Peter J. Acklam
[EMAIL PROTECTED] (Rick Measham) wrote: Maybe new() takes an optional ISOyear parameter? Thus the default 'year' is the way we commonly think of it and can take optional BC/BCE/AD/CE coding. It treats -1 as 1 BC and dies on getting '0'. ISOyear can only take integers with an optional '-'. I

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Rick Measham
On 13/2/03 9:05 am, Dave Rolsky at [EMAIL PROTECTED] spake thus: This is why there will be a DateTime::Format::ISO8601 module for parsing ISO formats ;) Dave, having worked with the DateTime::Format::iCal module, and with its innards, I wonder if it should be an OO module or not. There is

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Eugene van der Pijll
Peter J. Acklam schreef: ISO 8601 includes an expanded format which allows years outside of the range [,]. However, this expanded format should not be used unless it has been agreed upon by all parties involved. And I don't agree, so there! ;-) If iso8601() does not allow years

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Rick Measham
On 13/2/03 9:58 am, Eugene van der Pijll at [EMAIL PROTECTED] spake thus: I trust you completely. Unfortunately, ISO 8601 isn't avaliable online, and none of the summaries I've read contain the expanded format. I'm not sure how legal it is, but its available at

Re: DateTime, the year 0, and ISO8601

2003-02-12 Thread Dave Rolsky
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