Days in a year
The rule is: divisible by 4 is a leap year, unless divisible by 100, unless also divisible by 400. So 1900 was not and 2000 was. A great deal of software got 1900 wrong, and Excel still deliberately does — its date system counts 1900 as a leap year for compatibility with a spreadsheet from 1983.
Says how many days a year has, whether it is a leap year and why, how the days split between weekdays and weekends, and which days the year starts and ends on.
How to use the days in a year
The leap rule exists because the astronomical year is about 365.2422 days. Adding a day every four years overshoots slightly — that gives 365.25 — so a century year is skipped, which overcorrects, so a year divisible by 400 keeps its leap day after all. The result averages 365.2425 days, which drifts from the sun by about one day every 3,200 years.
That correction is why 1900 was not a leap year and 2000 was, and why an enormous amount of software has been wrong about it. Excel counts 1900 as a leap year on purpose: Lotus 1-2-3 had the bug in 1983 and Microsoft copied it for file compatibility, so every Excel date serial before 1 March 1900 is off by one to this day.
The weekday split is more useful than it looks. A year has 260, 261 or 262 weekdays depending on where the weekends fall, and that two-day spread moves annual capacity plans and payroll by close to one per cent — enough to notice, and easy to forget.
Questions
Divisible by 4, unless divisible by 100, unless also divisible by 400. So 1900 was not a leap year and 2000 was.