Formula for #Days Julian Calendar Falls Behind Gregorian

Fell down a bit of a rabbit hole, starting with reading this site and deciding to amuse myself by implementing a Gregorian-to-Roman conversion field in FileMaker.

The bit that ended up being the most difficult to implement reliably isn’t specific to the Roman calendar, it’s calculating the number of days that the Julian (Romanesque or Christian) falls behind the Gregorian due to the Julian insertion of leapyear days a tad more often than they oughta be inserted.

In addition to the PlanetCalc page I found this converter courtesy of the Wayback Machine and this Wikipedia entry as well.

Even though none of them explicitly provide a formula for “how many days do you subtract from the Gregorian month/day if the year is XXXX”, they each supply me with data, and I expected to be able to make some initial stabs and refine it until I had a formula pretty close to dead-on. I knew there were some limitations to any such formula if I wasn’t willing to consider “is this specific year a leap year and is today or is it not before February 29” — and instead simply take the year, get the number of years since the difference between calendars was 0, and divide it by some constant. But that should only throw my result off by a day for some brief interval — I figured it would reconcile within a year or two (is that a spurious assumption?).

Anyway, to get to the meat of it, what I get are weird variations. Using 3/1/200 as kickoff (Wikipedia lists that date as a date when the calendars agreed) the best factor I was able to narrow down to is Number of Days between specified Gregorian date and 3/1/200 divided by 44000, truncated to 0 decimal points. But sometimes that gives me a number lower than what Wikipedia stipulates (e.g. 3/1/500 I get1 day where Wikipedia says 2), but sometimes gives me a number higher (for 3/4/900 I get 5 days where Wiki says 4).

For 3/7/1000 Wikipedia says 6 but I get 5, and yet for 3/1/2100 has 14 but I’m getting 15. And no, my formula doesn’t catch up with the expected value within a year or so:

3/1/500: my formula doesn’t yield a 2 until I get to the year 531
3/5/700: I don’t get up to 4 until the year 772.
3/4/900: I reached 5 back at the year 893
3/1/2100: I rolled over to 15 in the year 2098

I get similar both-directions discrepancies when comparing to the PlanetCalc values. For 1/3/1390 they have an 8-day difference but I get a 9-day gap starting at 1375. For 1/3/1290 they say 7 but I have 8 starting at 1254. Then I’m spot-on with PlanetCalc’s gap values until I go back to 1/3/490 which they have as a 2-day difference that I don’t get to until the year 531, and 1/3/390 where they have a 1-day difference I don’t reach until I hit the year 411.

Can anyone clarify whatever I’m missing, or do you think these sites are using a flawed algorithm?

Are you taking into account when the year starts? It didn’t use to be January 1.

Edited to add: I cant tell if you’re using MM/DD/YYYY or DD/MM/YYYY ordering. You might consider using YYYY/MM/DD to remove any ambiguity.

If that were the problem, it would resolve within a year.

The formula being used doesn’t work because it averages the rate of increase over many centuries, then applies this constant rate of increase. A correct formula would need to account for the fact that the rate is not constant - it increases at a rate of one per century for three centuries and then does not increase in the fourth century.

This is the kind of thing I was wondering if I was failing to comprehend and take into account. We know it stair-steps rather suddenly when leap year is applied on the Julian calendar but not on the Gregorian, hmmph yeah, and it only actual does that on some century years, so those sudden stair-steps are pretty far apart. So my formula is about as good as it’s going to get for a straight-line approximation and I should be surprised about the discrepancies.

Fun fact - the Russian October Revolution happened Nov. 10th.

IIRC, the Eastern Orthodox religions use the Julian calendar still, since no pesky Catholic Pope is going to tell them what to do. I don’t know if they’ve modified the Julian calendar calculations to remove the built-in accumulating error.