## Leap Of Faith

September 29, 2005 by pradeepc

Finding out whether a year is a leap year or not can be a bit tricky. Till quite recently I thought that any year evenly divisible by 4 was a leap year. Not quite so. There is more to it. As a first criteria the year should be divisible by 4. If its not divisible by 4, its not a leap year. If the year is also divisible by 100 (i.e. in addition to being divisible by 4) then you have something more to worry about; else you are done (i.e. if it is not divisible by 100) – its a leap year. The something more you have to worry about is that the year should also be divisible by 400, else its not a leap year.

The concept of leap year was introduced because the actual time taken by earth to go around the sun (called sidereal year) is not exactly 365 days but 365.25635 days. So once in every 4 years we add a day to that year (so that it will have 366 days) and we call it a leap year. But the fun doesnt end there. Adding 1 day every 4 years introduces some error which is taken care by stipulating that every year divisible by 100 is a leap year if and only if it is also divisible by 400.

Use this logic for determining whether a year is a leap year or not :

IsLeapYear = ((Year Mod 4 == 0) AND (Year Mod 100 != 0) OR (Year Mod 400 == 0))

### Like this:

Like Loading...

*Related*

## Leave a Reply