Just wondering, is it possible to have a calendar system that automatically adjusts to the Earth's orbit around the sun dynamically with a precision/accuracy as high as possible? I imagine the calendar would need to note how long that calendar year was, how long a day was, and to what precision it is recorded.
It 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.
I do like the idea of variable length 'true' days as a more exact measure of the world around us but the thought terrifies me as a programmer (or even someone who needs to get practical things done). It's so much easier to reason about time in standard units even if they're wrong. Now if we were to eliminate day light savings, that would be a greatly appreciated change.
There’s precedent: the Babylonian day was 12 hours long; the night likewise. They knew sunrise and sunset so could set a given day’s hour to be 1/12th of the difference (and likewise the night’s).
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.
To clarify, daylight was divided in 12 periods of equal length called “hours”, as well as nighttime. This length depended on the day of the year, when measured with the current definition of hour. 24 hours was always a complete day.
Please no. Trying to sync time to Earth rotation is why we have leap seconds, and they are pretty much universally hated.
(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 Iranian calendar defines its new year based on the exact moment of the northern equinox; if the equinox is before noon (Iran standard time, I believe) then the new year is on that day, while if it's after noon the new year is on the next day. As a bonus, the month lengths are designed to be longer near aphelion, when the corresponding solar months (periods between 30-degree solar longitudes) are longer.
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).
Yes. There are two classes of calendar: observational and arithmetic.
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.
This just illustrates how important it is that we take care of our environment. Travelers think they can just pollule whatever, but that pollution does have very serious adverse affects. Tens of thousands of people just pop out of existance when a major temporal restructing like this happens. The whole correcting calenders handwavium, while preventing mass awakening, will never undo that tremendous loss of life from one careless adventurer.
Shift from Julian calendar to Gregorian. Easter wasn't at the right date any more due to the Earth's precession, so the Catholic church changed the calendar.
Different 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.
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.
And he was in part responsible for the mess since he assumed the role of Pontefix Maximus but was away from Rome to wage war left and right and didn't fulfil his yearly duties of syncing the calendar.
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 pontifex quite often used intercalary months for political ends, like lengthening terms of office. But as dictator, Caesar’s term was as long as he wanted, so why not fix the damn thing? Since taxes were determined by month, it’s much better to have stable months, so distant provinces knew for sure what day it was. Still, cool to imagine Caesar as a hacker automating his job.
I also ran across this a couple of years ago[1], and there's a cool twist to it for different regions (which adjusted their own calendars on different years): `ncal` correctly handles the skip differently for the UK:
$ 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
I distinctly remember being shown this ~35 years ago when I was first shown UNIX as a demonstration of how high-quality the commands were implemented... even something as weird as the calendar changeover was accounted for.
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.
I was introduced to this and other calendar quirks by Professor Edward Reingold when taking introduction to CS at UIUC. One of our "machine problems" (AKA programming assignments) was to write a date converter that could convert between Gregorian, Julian, and the French Revolutionary calendars.
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.
In medieval and renaissance Europe, would the average peasant have known the exact date of the current day, or did that not really concern them? I figured most living simply would only concern themselves with whereabouts in time they found themselves.
> [...] However, the actual solar year has been known to be around 365.2422 days since the 17th century. Although the difference appears to be too small, it leads to an error of adding 1 extra day every 128 years. To reduce this error, the Gregorian calendar was introduced in October 1582 by Pope Gregory XIII [...]
Huh? The error has been known since the 17th century, and its fix came in 1582?
> 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.
Note that the Gregorian Transition --- adoption of the Gregorina Calendar --- occurs at different places in different country's calendrical systems, with several countries not adopting the Gregorian calender until well into the 20th century. The Catholic adoption occurred in 1582. cal's September 1752 transition reflects practice in Great Britain.
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.
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....)
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.
30 comments
[ 1.6 ms ] story [ 88.2 ms ] threadIt 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.
Different 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.
https://eclipse.gsfc.nasa.gov/SEhelp/calendars.html
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.
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.
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.
Huh? The error has been known since the 17th century, and its fix came in 1582?
> 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.
https://archive.fo/UL6zx
https://news.ycombinator.com/item?id=29677477
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.