Entry
How can I check whether a year is a leap year?
May 10th, 2001 10:00
jsWalter, Martin Honnen,
A leap year is
divisible by 4 and (not divisible by 100 or divisible by 400)
So to check that use a JavaScript function alike
function isLeapYear (year) {
return (year % 4 == 0) &&
((year % 100 != 0) || (year % 400 == 0));
}
Examples:
alert(isLeapYear(2000))
alert(isLeapYear(1999))
wt 5/10/01
I have a collection of methods that extend the Date Object.
One of them solves this problem.
ww.torres.ws/javascript
Walter