The Math of Leap Days
The Bad Astronomer writes "We have leap days every four years because the Earth's day and year don't divide evenly. But there's more to it than that... a lot more. A year isn't exactly 365.25 days long, and that leads to needing more complicated math and rules for when we do and don't have a leap year. If you've ever wanted to see that math laid out, now's your chance, and it only comes along every four years. Except every hundred years. Except every four hundred years."
and it only comes along every for years.
Wow! That really IS rare!
I think we have different definitions of complicated.
On climagic I laid it out in less than 140 characters.
The whole 7 day week is rather random too- based on some out-of-date dogma that is probably mistranslated. (the original word in Genesis translated as "day" was more accurately "a period of time" although it was often "day" but not necessarily) - so we force the meaning of "day" onto it and have a 7 day week. Silly number.
Let's make a week 10 days- a much more logical number.
Actually 7-day week makes sense if you have a 28-day month.
"Deinde, ne in posterum a XII kalendas aprilis aequinoctium recedat, statuimus bissextum quarto quoque anno (uti mos est) continuari debere, praeterquam in centesimis annis; qui, quamvis bissextiles antea semper fuerint, qualem etiam esse volumus annum MDC, post eum tamen qui deinceps consequentur centesimi non omnes bissextiles sint, sed in quadringentis quibusque annis primi quique tres centesimi sine bissexto transigantur, quartus vero quisque centesimus bissextilis sit, ita ut annus MDCC, MDCCC, MDCCCC bissextiles non sint. Anno vero MM, more consueto dies bissextus intercaletur, februario dies XXIX continente, idemque ordo intermittendi intercalandique bissextum diem in quadringentis quibusque annis perpetuo conservetur."
This quote should make the algorithm clear to any competent programmer. Note that it contains the explicit example that in the year 2000, February contains 29 days.
Of course, it can be expressed in many fewer characters in most programming languages. But the pope's astronomer didn't have any programming languages available back in 1582.
It can be fun to point out that the above Latin passage is still the "official" definition of the leap year scheme, since no standards body has tried to revise it. As far as I've been able to determine, that is; let me know if this has ever actually happened. It'd be especially fun if some standards body had tried to rephrase this in a modern language, but got it wrong. If so, they were probably shocked to discover that a 16th-century pope's edict trumped their scientific calcuations.
(The /. software guys might be able to block posting in Russian or Chinese or Arabic, but it's a lot harder to prevent people from using Latin. ;-)
Those who do study history are doomed to stand helplessly by while everyone else repeats it.
Our whole calendar is messed up. First- Jan 1st is a poor start date.
I suspect the original pioneers intended the year to start on the Winter Solstice-
Yes, but Julius Caesar decided to start it on the first new moon following. And based on the best data available at the time, every 19th year would have started on a new moon (see below).
which is more like Dec 21st most years on our calendar.
More like Dec 25 at the time, hence the date of Christmas.
So- The year should start on Dec21st.
It took almost 2500 years for everyone to agree to start their year with January (instead of March). George Washington himself was fuzzy on what year he was born. Now, after just getting things straightened out (on a relative time scale), you want to fuck with it again?
Then- our months are supposed to be based on cycles of the moon (Approx every 28 days)-
29.5 days. The usual approximation is alternating months of 29 days and 30 days in length.
but because there were 13 and superstitious nitwits didn't like 13 we have 12 months with varying days.
13-month years work for all the cultures with a lunar calendar, e. g. the Jews and the Chinese. The biggest problem is reckoning when the 13th month gets added. If you treat the tropical year as 365 days, you have to add an extra synodic month 7 times in 19 years (Metonic cycle). If you use 365.25 days for a tropical year, it's more accurate to say that 28 are added in 76 years (Callippic cycle). And if you're using the even-more-accurate 365.2425-day approximation... well, go search for the term "epact."
The whole 7 day week is rather random too-
Try counting the number of days between the first visibility of the new crescent moon and first quarter. Only your eyes and your ability to estimate the illumination of the moon are allowed.
based on some out-of-date dogma that is probably mistranslated. (the original word in Genesis translated as "day" was more accurately "a period of time" although it was often "day" but not necessarily)
If you're referring to chapter 1, note that "day" is always paired with "night."
Let's make a week 10 days- a much more logical number.
Revolutionary France called, they want their "decades" back.
Regardless, (365 mod 7) = 1 while (365 mod 10) = 5.
So we have 36 weeks in a year. If we MUST have a bigger break- we can divide these into 9 months of 4 weeks each.
Even Revolutionary France understood the importance of the four seasons, with agriculture being the foundation of modern civilization and all.
We would then have 5 or 6 days at the end- a "half week"
Coptic Egyptians want their "epagomenal days" back.
Not perfect- but based more on logic than our current system and no-silly formulas needed (other than determining the solstice)
And you would once again have devised a calendar system that focuses on rationalism at the expense of pragmatism and utility, using many ideas have have been tried for centuries or even millennia. Here's what you'd be abandoning:
In fact, 2, 4 and 6 above were deliberate design choices on the part of Julius Caesar specifically to keep things simple.
No, the REAL nightmare for programmers is daylight savings time. Especially in the spring, when local times jump back and repeat. Ugh.
That's why you should save the time in UTC format, and then let the OS help you translate that into a display time.
Battlemaster--Game with friends in medival realms