5 ms·
I wrote my own date calculation functions a while ago. And during that, I had an aha moment to treat March 1 as the beginning of the year during internal calcul
by kccqzy 11mo ago
I wrote my own date calculation functions a while ago. And during that, I had an aha moment to treat March 1 as the beginning of the year during internal calculations[0]. I thought it was a stroke of genius. It turns out this article says that’s the traditional way.
[0]: https://github.com/kccqzy/smartcal/blob/9cfddf7e85c2c65aa6dec1ac183a73a58379e8f8/src/smartcal/core.cljs#L88 https://github.com/kccqzy/smartcal/blob/9cfddf7e85c2c65aa6de...
- silisili 11mo agoAt this risk of me feeling stupid, could you briefly explain the benefit of this?
- da_chicken 11mo agoIt's easy to know what day of the year it is because leap days are at the end.
- kccqzy 11mo agoI just added a link to the code with a brief comment. Basically, it simplifies the leap year date calculation. If February is the last month of the year, then the possibly-existing leap day is the last day of the year. If you do it the normal way your calculations for March through December need to know whether February is a leap year. Now none of that is needed. You don’t even need explicit code to calculate whether a given year is a leap year: it’s implicit in the constants 146097, 36524, and 1461.
- zamadatix 11mo agoThe magic numbers at the end of this explanation are the number of days of each part of the leap year cycle: 146097 days = 400 year portion of the leap year cycles (including leap years during that) 36524 days = same for the 100 year portion of the leap year cycles 1461 days = 4 year cycle + 1 leap day
- d--b 11mo agoIIRC, it's also why the leap day was set to Feb 29th in the first place. At the time (romans?) the year started March 1st. In case someone was wondering why in the world someone said we should add a day to the second month of the year...
- amenghra 11mo agoAnd (oct)ober was the 8th month of the year, (nov)ember the ninth, (dec)ember the tenth!
- Izikiel43 11mo agoDon't forget (sep)tember being the 7th month
- sltkr 11mo agoWeird parenthesization. The latin numbers are septem, octo, novem, decem for 7, 8, 9, 10. And then they all have a -ber suffix.
- amenghra 11mo agoThe three letter prefixes show up in English (eg oct in octal, dec in decimal, etc.).
- thaumasiotes 11mo agoThe prefix in "decimal" is "decim", like you'd expect given that the root is "decem". There is no "dec-" prefix. (You do see "deca" used as a prefix, "a" included, but that doesn't come from Latin.)
- amenghra 11mo agoYou are right. I should have written: (septem)ber was the 7th month of the year, (octo)ber was the 8th, (novem)ber the ninth, and (decem)ber the tenth!
- 3eb7988a1663 11mo agoNot so relevant, but some fun history, the Roman calendar did start in March, so tacking on the leap years was done at the finale. This also meant that the root of the words - the "oct" in october means 8 was also the eighth month of the year.
- zimpenfish 11mo agoAs well as the leap year stuff people have mentioned, there was something else that I've got a vague memory of (from an old SciAm article, IIRC, which was about using March as the first month for calculations) which pointed out that if you use March as 0, you can multiple the month number by (I forget exactly what but it was around 30.4ish?) and, if you round the fraction up, you get the day number of the start of that month and it all works out correctly for the right 31-30-31 etc sequence.
- deleted 11mo ago[deleted]
- zokier 11mo agonot completely coincidentally, March was also the first month of the year in many historical calendars. Afaik that also explains why the month names have offset to them (sept, oct, nov, dec) edit: I just love that there are like 5 different comments pointing out this same thing
- Mikhail_Edoshin 11mo agoI've read that not only March was the first month, but the number of months was only ten: winter months did not need to be counted because there was no agricultural work to be done (which was the primary purpose of the calendar). So after the tenth month there was a strange unmapped period.
- _dain_ 11mo ago>So after the tenth month there was a strange unmapped period. this is when time-travelling fugitives hide out
- Dylan16807 11mo agoHow do you figure out it's March 1 if you're not counting days?
- eru 11mo agoEquinox or something like that?
- Dylan16807 11mo agoThe precise equinox sounds fussy to measure and even then you need to know three weeks before the equinox. While counting days is very easy.
- eru 11mo agoYes. But they also added leap days on an ad hoc basis right until the Caesar reformed the calendar. So some fussiness would probably not deter the much earlier Romans. (It's still evidence in the direction you suggest, just much weaker than it looks at first.)