in reply to Problem with DateTime subtract_datetime
Maybe you just need better formatting of your DateTime::Duration?
use DateTime; use DateTime::Format::Human::Duration; my $endDate = DateTime->new(year => 2015, month => 02, day => 24, time_zone => 'America/New_York'); my $now = DateTime->now( 'time_zone' => 'America/New_York' ); my $durfmt = DateTime::Format::Human::Duration->new(); print $durfmt->format_duration_between($now, $endDate), "\n"; __END__ 5 days, 6 hours, 58 minutes, and 30 seconds
|
|---|