Subject: | DateTime::Duration in seconds |
Why DateTime::Duration can't return full delta in seconds (or other
units)?
Minimal code is:
my ($m, $s) = $dt2->delta_ms( $dt1 )->in_units('minutes', 'seconds');
print Dumper(
[$dt1->iso8601, $dt2->iso8601],
$dt2->subtract_datetime( $dt1 )->in_units('seconds'),
[$dt2->subtract_datetime( $dt1 )->in_units('minutes', 'seconds')],
$dt2->delta_ms( $dt1 )->in_units('seconds'),
[$dt2->delta_ms( $dt1 )->in_units('minutes', 'seconds')],
$m*60+$s,
);
$VAR1 = [
'2012-07-15T13:40:00',
'2012-08-15T14:42:03'
];
$VAR2 = 3;
$VAR3 = [
62,
3
];
$VAR4 = 3;
$VAR5 = [
44702,
3
];
$VAR6 = 2682123;