Hello,
I have a problem with Add_Delta_Days function of the Date::Calc module.
The problem id the month returned doesn't have a 0 before the mon the number if it under 10:
After I have to add or substract some days with Add_Delta_Days:
My problem is that the $month1 variable is equal to 3, but I would like to have the two digits format MM for the month --> 03.
I search in the documentation and on internet and found nothing.
Does anyone have an idea ?
I have a problem with Add_Delta_Days function of the Date::Calc module.
The problem id the month returned doesn't have a 0 before the mon the number if it under 10:
Code:
my $dateinputscript = 16032006
my $date = $dateinputscript;
my $day = $date ;
$day =~ s/(\d\d)(\d\d)\d\d(\d\d)/$1/;
my $month = $date;
$month =~ s/(\d\d)(\d\d)\d\d(\d\d)/$2/;
my $year = $date;
$year =~ s/(\d\d)(\d\d)(\d\d\d\d)/$3/;
After I have to add or substract some days with Add_Delta_Days:
Code:
($year1,[COLOR=red] $month1 [/color], $jm1) = Add_Delta_Days($year,$month,$day,
-1);
My problem is that the $month1 variable is equal to 3, but I would like to have the two digits format MM for the month --> 03.
I search in the documentation and on internet and found nothing.
Does anyone have an idea ?