5 ms·
At this risk of me feeling stupid, could you briefly explain the benefit of this?
by silisili 11mo ago
At 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!
- variaga 11mo agoThat's correct, the Romans had March as the first month of the year, so leap day was the last day of the year and September, October, November and December were the 7th (sept), 8th (oct), ninth (nov) and 10th (dec) months.
- jcranmer 11mo agoThe calendar was regularized to include a leap day during the reign of Julius Caesar (hence the name "Julian calendar"), which would have been 45 BC. The Roman calendar moved to January as the first month of the year in 153 BC, over a hundred years before the leap day was added. The 10-month calendar may not have even existed--we see no contemporary evidence of its existence, only reports of its existence from centuries hence and the change there is attributed to a mythical character.
- anyfoo 11mo agoAre you saying that while we do see evidence that September, October, November, December were once the 7th, 8th, 9th, and 10th month, we don't see any evidence that the calendar was ever "10 months long"? (How would that have worked anyway, did they have more days per month?)
- jcranmer 11mo agoPretty much. > How would that have worked anyway, did they have more days per month? The way I've heard, they just simply didn't track the date during the winter.
- pbhjpbhj 11mo agoWikipedia gives 3 dates for January being the first month, either (approx) 700, 450, 150 BCE. It's fair to say January was the first month of the Roman calendar; despite it having formerly been March.
- eru 11mo agoBtw, the Romans had leap days before Julius Caesar, but they were added ad hoc by the Pontifex Maximus. Caesar happened to be the Pontifex Maximus (an office you hold for life once elected to), but he wasn't in Rome much to do that job. So after he came back from hanging out with Cleopatra in Egypt he came back and set the calendar on auto-pilot.
- avadodin 11mo agoI don't know if it ever made it to production, and I don't remember exactly why it made sense at the time, but one early hack I did was passing a date in Julian format because there weren't enough bits to pass a full timestamp.
- deleted 11mo ago[deleted]
- wizzwizz4 11mo agoTechnically, the leap day (bissextus) was the 24th. (Wikipedia tells me this is because that's when Mercedonius used to be, before the Julian reforms.)
- 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.