Re: definition of correctness

[email protected] ("Dr.Ruud")
Newsgroups perl.datetime
Organization Chaos rules.
Message-ID <[email protected]>
"bharanee rathna" schreef:

> -- POSIX::mktime
> perl -MPOSIX -le 'print scalar
> localtime(mktime(0,0,2+24,4,9,108,0,0,-1))' Sun Oct  5 03:00:00 2008
> perl -MPOSIX -le 'print scalar
> localtime(mktime(0,0,2+25,4,9,108,0,0,-1))' Sun Oct  5 03:00:00 2008
> perl -MPOSIX -le 'print scalar
> localtime(mktime(0,0,2+48,4,9,108,0,0,-1))' Mon Oct  6 02:00:00 2008
>
> -- DateTime
> perl -MDateTime -le '$dt = DateTime->new(day => 4, month => 10, year
> => 2008, hour => 2, time_zone => "Australia/Melbourne"); print
> $dt->add(hours => 24)'
> 2008-10-05T03:00:00
> perl -MDateTime -le '$dt = DateTime->new(day => 4, month => 10, year
> => 2008, hour => 2, time_zone => "Australia/Melbourne"); print
> $dt->add(hours => 25)'
> 2008-10-05T04:00:00
> perl -MDateTime -le '$dt = DateTime->new(day => 4, month => 10, year
> => 2008, hour => 2, time_zone => "Australia/Melbourne"); print
> $dt->add(hours => 48)'
> 2008-10-06T03:00:00

Probably because the start point of your POSIX calculations are at
00:00, and those of your DateTime-calculations are at 02:00?

-- 
Affijn, Ruud

"Gewoon is een tijger."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.