The unix cal and ncal programs show 1700 CE as a leap year: $ cal 1700
(Feb shows 29 days). The common algorithm for integer divisibility by 4, 100, and 400 gives 1700 as a common year--Check if year is leap year in javascript (See answer by Meersseman). Since 1700 is well after the adoption of the Gregorian calendar what is the explanation? I'm using Ubuntu precise.
-
You are aware of that the [Gregorian switch](http://www.timeanddate.com/calendar/julian-gregorian-switch.html) didn't happen at the same time in all countries? For example, in [Sweden it happened before 1700](http://www.timeanddate.com/calendar/?year=1700&country=21) but in [the UK it happened after](http://www.timeanddate.com/calendar/?year=1700&country=9) – Some programmer dude Apr 11 '16 at 09:14
-
I didn't know that. Thanks! – Brent F Apr 11 '16 at 10:32
-
Joachim, that was the answer I needed. Thanks again! – Brent F Apr 11 '16 at 10:51
1 Answers
Like much other software, JavaScript models the proleptic Gregorian Calendar for simplicity. So do specifications like ISO 8601. However, it appears that the cal
software does not. It models the Julian to Gregorian switch-over as described in the docs:
The cal utility shall write a calendar to standard output using the Julian calendar for dates from January 1, 1 through September 2, 1752 and the Gregorian calendar for dates from September 14, 1752 through December 31, 9999 as though the Gregorian calendar had been adopted on September 14, 1752.
By the Julian calendar, a leap year occurs simply every four years, and thus 1700 is indeed a leap year.
Also note that the authors of cal
chose to use the 1752 date of when the British Empire adopted the Gregorian calendar - but this date varies considerably by country.

- 230,703
- 74
- 448
- 575
-
Thanks, Matt. Don't know why I didn't read the docs!? Very informative answer. – Brent F Apr 21 '16 at 17:58