use Date::Calc qw/Delta_DHMS/; ... my @date_one = qw/2002 04 25 23 12 40/; my @date_two = qw/2002 03 23 15 25 21/; my ($dd, $dh, $dm, $ds) = Delta_DHMS(@date_one, @date_two);