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 the output year is
negative.  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.  The code

    return sprintf( "%04d%s%02d%s%02d",
                    $self->{c}{year}, $sep,
                    $self->{c}{month}, $sep,
                    $self->{c}{day} );

should use '%0.4d', not '%04d', for the year.

Peter

-- 
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;

Reply via email to