in reply to Re: date span in YYYYMMDD
in thread date span in YYYYMMDD
my @days = ( [ qw(31 28 31 30 31 30 31 31 30 31 30 31) ], # non-leap [ qw(31 29 31 30 31 30 31 31 30 31 30 31) ] # leap )
A function to return 0 when a gives year is not a leap year, and 1 if it is:
and you can use it likesub leap { my $y = shift; return ($y % 4 == 0 && $y % 100 != 0) || $y % 400 == 0; }
my $leap = leap($y); ... $days[$leap][$m]
Arjen
|
|---|