in reply to Checking for leap year
Unfortunately, this isn't thorough. Leap years don't occur if the year is a centennial year (although they do occur every 4th century). Here is what we in some of the NMS scripts:
sub is_leap { my $y = shift; return (!($y % 100) && !($y % 400)) || (($y % 100) && !($y % 4)); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Re: Checking for leap year
by merlyn (Sage) on Feb 20, 2002 at 03:32 UTC |