in reply to Re^2: How do I tell the time between two dates?
in thread How do I tell the time between two dates?
use strictures; use DateTime; use DateTime::Format::Human::Duration; my $hire = DateTime->new( year => 1605, month => 11, day => 5 ); my $now = DateTime->new( year => 1606, month => 1, day => 31 ); my $span = DateTime::Format::Human::Duration->new(); my $dur = $now - $hire; print $span->format_duration($dur), $/;
2 months, 3 weeks, and 5 days
DateTime & DateTime::Format::Human::Duration & :P :P :P
|
|---|