An Elucidation on the Elusive Proliptic Gregorian Ordinal

This is “kind of” a continuation on an anti-geek theme I’ve propounded before. You may or may not have encountered the comment that the content of this site began with an orientation to being of service to a (then) 12-year-old grandson. That said, I find Python documents that use this kind of vocabulary, without inclusive explanation and illustration, to be personally offensive and completely counter to the spirit of clarity and simplicity that is the soul of Python. So, while extensively updating the reference article(s) on datetime, time, and calendar, I ran into and decided to rant again, about this type of elitist, and I believe purposefully obtuse, explanatory construction. The indubitable conclusion of any observant reader must be that the effect of this sort of prescriptive documentation cannot be inadvertent.

This offensive phrase, in whole or in part, is found in absolutely essential explanations of date objects and their methods in the documentation for the datetime module. Now to be perfectly fair, early on the article notes that the date object “matches the definition of the ‘proleptic Gregorian’ calendar in Dershowitz and Reingold’s book Calendrical Calculations”. You can have your very own hard cover edition for $206.38 from Amazon – or a paperback edition for a bit less than half that. I seem to have misplaced my copy, but it was probably worn and tattered from extensive use anyway.

So, let me share the basics of what should have been explained if, as an average reader of average education and intelligence, like me, you want to understand the phrase “proliptic Gregorian ordinal”.

“Gregorian” refers to the calendar system most widely used in the world currently which was introduced in 1582 by Pope Gregory XIII as a long overdue improvement on the “Julian” calendar. It bears Gregory’s moniker though thought to be primarily designed by a German Jesuit mathematician and astronomer named Christopher Clavius. Gregory introduced leap years which was, and is, one of the big difficult obstacles in the development of date algorithms. We will ignore the fact, as does the datetime module, that the Gregorian system is good but not perfect.

When the Gregorian Calendar was introduced, time was moved ahead to adjust for the slipped timing of Christmas, Easter or the equinox (pick your expert opinion) noted as far back as the 1200’s by Roger Bacon. At any rate, October 4, 1582 was followed by October 15, 1582, so that became the first day of the Gregorian Calendar. That would make it day 1, but that would not do at all – to maintain any semblance of sanity and order, time absolutely had to extend into the past.

With this realization, the word “proleptic” becomes important. Proleptic comes from the base word prolepsis. The Oxford Dictionary’s second meaning of the word prolepsis is “representation of a thing as existing before it actually does…”. So, the proleptic Gregorian calendar is one that has been extended backward from October 15, 1582, using the same rules that enables us to extend it forward – for which you need only refer to your copy of Calendrical Calculations.

We are definitely closing in on this son-of-a-bitch. Now for ordinal. By context we know this use of “ordinal” designates it as a noun, so in this case it means: a number that designates an immutable position in an ordered sequence. (Interestingly, “ordinal” can take on slightly different definitions depending on whether you are using it in reference to art, business, computing, medicine, religion, slang, or sports – it is a very utilitarian term.) Putting it all together, days starting at 0001-01-01 are going to be numbered sequentially, beginning with 1; each being an “ordinal” designating its place in the chain of days stretching from year 1 (not year 0 – that’s another possible article) to year 9999.

For purposes of exploration, let’s note there is a class method called “.fromordinal(ordinal integer)” which take in an integer and gives back the date that is that many days away from day 1; if we use 577449 (that would be 577,449 days after 0001-01-01) the result would be 1582-01-01. As of the date this is being written (6/19/18) you would have to put in 736864 to get today’s date. Those numbers are easy to get because there is a datetime.date instance method called “.toordinal()” which does the reverse and gives us the number of days back to day1 when provided a date instance. Put in the date 1582-01-01 and it will give you 577449. Those numbers (577499 and 736864) are ordinal instances – they are proliptic Gregorian ordinals, to be exact.

</p>
import datetime
print("minyear and maxyear module constants")
print(datetime.MINYEAR, datetime.MAXYEAR, end='\n')
print("This shows how the class datetime.date .fromordinal method works:")
print('from ordinal 1 by class')
print(datetime.date.fromordinal(1))
print('from ordinal 2 by class')
print(datetime.date.fromordinal(2))
print('from ordinal 366 by class')
print(datetime.date.fromordinal(366))
print('from ordinal 577449 by class')
print(datetime.date.fromordinal(577449)) 

… will yield:
minyear and maxyear module constants
1 9999
This shows how the class datetime.date .fromordinal method works:
from ordinal 1 by class
0001-01-01
from ordinal 2 by class
0001-01-02
from ordinal 366 by class
0002-01-01
from ordinal 577449 by class
1582-01-01