Calendars
Leap years
The rule
A year is a leap year when it divides by 4, except that years dividing by 100 are not leap years, unless they also divide by 400. So 1900 and 2100 are not leap years, while 2000 and 2400 are. A leap year has 366 days because it adds 29 February.
The reason is that Earth takes about 365.2422 days to go round the sun. Adding a day every fourth year over-corrects slightly, and skipping three leap years every 400 years brings the average calendar year to 365.2425 days.
Upcoming leap years
2028, 2032, 2036, 2040, 2044, 2048, 2052, 2056, 2060, 2064.
This is the leap day rule. Leap seconds are a different thing: see leap seconds and continuous UTC.