Perlfunc: is_leap_year

Is the given year a leap year. Simple.

sub is_leap_year() { my $year = shift(); if ($year % 400 == 0) { return 1; } elsif ($year % 100 == 0) { return 0; } elsif ($year % 4 == 0) { return 1; } else { return 0; } }


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 44.192.15.251
To prevent spam please submit by clicking the kitten: