sam83uk said:write a func to null out the 30th date in the feb array if the year is divisible by 4
Not every leap year is divisible by four, though. I believe the general algorithm is:
Code:
if year mod 400 eq 0 // leap year
else if year mod 100 eq 0 // no leap year
else if year mod 4 eq 0 // leap year
else // no leap year
Edit: Yep:
The Gregorian calendar, the current standard calendar in most of the world, adds a 29th day to February in all years evenly divisible by 4, except for centennial years (those ending in -00), which receive the extra day only if they are evenly divisible by 400. Thus 1600, 2000 and 2400 are leap years but 1700, 1800, 1900 and 2100 are not.
Last edited: