I have this routine,
I want to save that delta to count the days between all to and from days in the from-to pairs
I have in the 2 dimensional array, I just need the workdays.
Say for
$date_from = 2012-02-09;
$date_to = 2012-02-13;
$delta_string = 4
sub calc_usage {
use Date::Manip::Date;
my $date_from;
my $date_to;
my $delta;
my $i;
for $i (0 .. $#DATE_HOLDER) {
$date_from = new Date::Manip::Date;
$date_to = new Date::Manip::Date;
$date_from->parse($DATE_HOLDER[$i][0]);
$date_to->parse($DATE_HOLDER[$i][1]);
$delta = $date_from->calc($date_to, "business");
}
}
To retrieve the delta values, you have to use the folllowing:
wich gives an array of 7 elements where:
you can also use it in scalar context:
wich gives a string with the same 7 elements colon separated: