Thanks guys I am aware of the leap year but I did not want to further confuse myself so for now I am just trying to ease myself in to understanding. I added this sub routine but it only keeps 365 so even if put a date of 2 years e.g. 1-jan-2000 to 1-jan-2002 it still only gives 365 as the number of days.
sub isFullYear{ my$startDay=shift; my$endDay=shift; my$sMon=shift; my$eMon=shift; my$fullYear; if ( NumberOfDaysBetween($startDay,$endDay ,$endDay,$eMon) == 365){ $fullYear=365; } return $fullYear; }
this is the call for the sub in the main
my$years= ($cy-$y) * isFullYear($d,$cd ,$m,$cm); $days= $days + NumberOfDaysBetween($d,31,$m,12) + NumberOfDaysBetween( +1,$cd,1,$cm) + $years; print "$days";
In reply to Re^2: perl basic count days between two dates
by scripter87
in thread perl basic count days between two dates
by scripter87
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |