Year Y is a leap year if Y is perfectly divisible by 4, and
- not by 100, or
- by 100 and 400
The following sources follow the rule above:
- Python (output of
calendar.monthrange(1000,2)
is (5, 28)) - webconversiononline.com
However, the following sources say 1000 was a leap year:
- Linux cal (command
cal 2 1000
displays 29 days) - timeanddate.com
The Gregorian system was introduced in 1582, where the rule above apparently started to apply (before 1582, the only requirement was perfect division by 4). However, testing several other year values (100, 500, 600, 700, 900, 1100, 1300, 1400, 1500 and 1700) indicate that only after and including 1800 the results of Python and Linux cal agree.
Why do these sources give different answers?