http://qs321.pair.com?node_id=1179293


in reply to Re^3: DateCalc using Date::Manip
in thread DateCalc using Date::Manip

Try
my $err; my $dtopt= DateCalc( $dt1 ,$dt2, \$err, 3);
instead of your original code to do the calculation.