Cal 9 1752
susam.in
susam.in
And, yes, it exists even in the earliest versions of the "cal" command, dating back to the mid 1970s: https://github.com/dspinellis/unix-history-repo/blob/Researc...
The implementation is pretty clever as well. The jan1() function simply returns the day-of-week the year starts on (and knows about the calendar-system change). The cal() function compares jan1(y) and jan1(y+1) to detect leap years by noticing if the weekday of Jan 1st advances one or two days.. and if it's anything else it assumes it's handling the 1752 case. Then inside of the printing loop it just jumps from 2 to 14 whenever it is rendering a month that happens to contain 19 days.
The year -45 has been called the "year of confusion," because in that year Julius
Caesar inserted 90 days to bring the months of the Roman calendar back to their
traditional place with respect to the seasons.
Even if you don't explicitly deal with historical calendars it is important to understand calendaring in many software engineering areas.The role of the Pontefix Maximus was to insert intercalar months to sync the calendar to seasons.
With the reform he basically automated himself out of the job.
> The guy that originally wrote the "cal" command on some old Version 7 machine had an off-by-one error in his code. This showed up as some erroneous output when a malloc'd variable overwrote 12 extra bytes with zeroes, thus leading to the strange calendar output seen above.
> Now, nobody in his right mind really cares about the calendar for September 1752. Even the idea of the year 1752 does not exist under UNIX, because time did not begin for UNIX until early 1970. As a result, nobody even knew that "cal" had this error until much later. By then there were thousands of copies of "cal" floating around, many of them binary-only. It was too late to fix them all.
> So in mid-1975, some high-level AT&T officials met with the Pope, and came to an agreement. The calendar was retroactively changed to bring September 1752 in line with UNIX reality. Since the calendar was changed by counting backwards from September 14, 1752, none of the dates after that were affected. The dates before that were all moved by 12 days. They also fixed the man page for "cal" to document the bug as a feature.
> The 11 days from September 3 to September 13 were simply gone from the records. They searched the history books and found that fortunately nothing of much significance happened during those 11 days.
> Overall, this whole incident was pretty much a non-event. One science fiction author later heard about it, and blew the thing up into a full-length work of science-fiction called "The Lathe of Heaven", a book that in my opinion bears little resemblence to what really happened.
Dates from 1752 were in the test set.
The French Revolutionary Calendar was interesting. Ten days in the week, 3 weeks per month, with a extra "bonus" month at the end of the year with 5 (or 6) days. One reason it didn't last is that despite the change in the week length, workers only got 2 days off per week.
$ ncal -s GB 9 1752
September 1752
Mo 18 25
Tu 1 19 26
We 2 20 27
Th 14 21 28
Fr 15 22 29
Sa 16 23 30
Su 17 24
[1]: https://blog.yossarian.net/2015/06/09/Dates-That-Dont-ExistIt would be interesting if systems never had to account for a leap day every n years. I suppose 0.003% of a day (the error rate each year) each year isn't a big enough concern, otherwise known as 2.592 seconds.
They clearly knew the extreme cases (the solstices and equinoxes) but I don’t know if they actually adjusted each day; I don’t know how they actually market the hours, much less why they would bother.
Even the “minute” (small part) and “second” (the second division) were measured only due to the development of technology that allowed it.
(They are hated, because AFAIK they are unpredictable, which also answers your question, assuming you were asking about purely algorithmic/mathematical way without any outside inputs.)
The Chinese calendar is defined (since 1644) based on the days of true new moons and solar terms (corresponding to 15-degree solar longitudes), which also makes it purely astronomically defined.
The various Indian calendars are mostly defined using traditional astronomical texts, but I think there have been occasional attempts to update them to modern astronomical knowledge.
I'm not sure where the rate 0.003% of a day per year comes from in your comment; even the error in the Gregorian calendar is longer than this (if measured based on the northern equinox, about 12 seconds; if measured based on the mean tropical year, about 27 seconds).
Modern calendars tend to be arithmetic, based on fixed rules that approximate astronomy more or less accurately. The Julian calendar is one of the simplest; the Jewish calendar is one of the most complicated and most accurate.
Observational calendars are more directly based on astronomical observations. The Muslim calendar is one example: in some traditions, the start of Ramadan can’t be predicted exactly because it depends on seeing the new moon. UTC is also an observational calendar, since leap seconds are scheduled by observation not by fixed rules. The French revolutionary calendar was also (in its strict form) observational, keeping its years precisely in sync with the equinoxes.
Many people are aware of the fact that Russia's "October Revolution" occurred in November by the reckoning of much of the world. China's adoption didn't occur until the 1940s, Saudi Arabia in 2016. Ethiopia, Iran, Afghanistan, and Nepal have not adopted the Gregorian calendar.
Elsewhere and earlier in Europe, adoption was generally earlier in Catholic countries and later in Protestant ones.
https://en.wikipedia.org/wiki/Adoption_of_the_Gregorian_cale...
Though not focused specifically on the Gregorian calendar, Eviatar Zerubavel's The seven day circle : the history and meaning of the week covers the surprisingly complex and interdependent history of calendars and timekeeping, including several attempts to "rationalise" the week into a ten-day interval (in both France and Russia). Neither proved ultimately successful --- it's extraordinarily difficult to operate out-of-sync with the rest of the world. (Ask me how I know....)
https://www.worldcat.org/title/seven-day-circle-the-history-...
It's all a helpful reminder that concepts of time and timekeeping are human creations serving human needs and limited by understanding and measurement capabilities.
Huh? The error has been known since the 17th century, and its fix came in 1582?
September 1752
Su Mo Tu We Th Fr Sa
1 2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
why why why why why whyDifferent countries changed at different times. Quite a bit of Europe did the switch in October of 1582 when Pope Gregory instituted the new calendar, and skipped 10 days. England waited until 1752, by then the Earth had precessed enough that another day had to be skipped.