While Mark was working for us last week, he and I spent some time working on converting a Julian Year / Month / Day into the format used by Ancient Romans. We already have methods that convert a Gregorian Dates into Julian Dates, as well as methods for Delphi TDateTime to be converted into the Julian Calendar – so for this exercise we decided to just concentrate on the Julian Calendar since it has natural ties to the Roman Dates.
Currently in the routines discussed below we are using our Number System rather than Roman Numerals.
The Roman Calendar Year starts from the Year that Roman was founded, and that is taken to be 753 BC – and so that is defined to be 1 A.U.C. (Ab Urbe Conditia) – so we add a Method to convert a Julian Year into a Roman Year, and since it takes a very long time for Julian Years and Gregorian Years to get out of sync, this routine does reasonably well for our current Years 🙂
For our purposes we are just going to leave the Month Names as they are in the Regional Settings – but use the Short version.
Roman Days in the Month revolve around 3 times in the month: Kalendar (New Moon), Nones (First Quarter) and Ides (Full Moon). So we added 3 Methods that returned the Day of the Month that each of these occur given the specific Month.
If it is the day before one of the special days, then it is referred to as “pridie” – so the day before the “Ides of March” is “pride Ides of March” – like we use “eve” in Christmas Eve.
So if the day is not one of the three special days, nor the day immediately before it, then it is the inclusive count of days prior to the event – so two days before the “Ides of March” is “a.d. 3 Ides of March” – do note that two days before gets us a “3” not a “2” because we count inclusive of the date; and the “a.d.” stands for “ante diem”.
One other issue we have to deal with is Leap Years – the Leap Day in the Roman Calendar still gets put into February – but unlike our adding a “29th day” – we need to add an extra “a.d. 6 Kalendar of February” and so this extra “6” gets a “bis” added to it: “a.d. bis 6 Kalendar February”.
So we defined a Enumerated Type that represents the different options above, and then a method that takes a Julian Year / Month / Day and returns the Roman Date Type, as well as the number of “a.d. days” if required. We then constructed a method that used this method so as to take a Julian Year / Month / Day and convert it to a string.
When we add the above Method to a future Roman Date Class we will allow the various strings being used to be customised 🙂
Whilst the above routines have been developed in the new ESBDevLib, they will also be included in ESBPCS for VCL v6.1.1 in the new unit ESBPCSRomanDates due out in early January 2013.
Based on information from Calendrical Calculations, 3rd Edition by Nachum Dershowitz and Edward M. Reingold.