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, but you claimed it was defined for the
range [0000,9999]. The above date falls outside of this range, and the
proper output of iso8601() is unspecified.

Of course, it might be a good idea to change the format for BC years.
But it's not required by ISO 8601.

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.

But should new() know what to do when it receives the year '1381AH'?
'2756AUC'? '29BP'? '26 anno regni regis Iulianae'?

Eugene

Reply via email to