I could be reading the documentation wrong for ->seconds (aka
in_units('seconds'); but it seems to me it should be returning the
number of seconds in the duration... it doesn't. Not even close. It
seems there are some missing computations in the in_units method:
use strict;
use warnings;
use Test::More;
use DateTime;
{
my $date1 = DateTime->new(
year => 2001, month => 5, day => 10,
hour => 4, minute => 3, second => 2,
nanosecond => 12,
time_zone => 'UTC'
);
my $date2 = DateTime->new(
year => 2001, month => 6, day => 12,
hour => 5, minute => 7, second => 23,
nanosecond => 7,
time_zone => 'UTC'
);
is( ($date2 - $date1)->seconds, 2855061, "roughly 285ksec");
}
done_testing();
If riding in an airplane is flying, then riding in a boat is swimming.
115 jumps, 47.9 minutes of freefall, 91.6 freefall miles.