Delphi Methods for Dates in Ancient Roman Format

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.

RomanDates

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.

About esbglenn

Software Developer working at our Family owned business, ESB Consultancy, which is located in Kalgoorlie-Boulder, in the Eastern Goldfields of Western Australia.
This entry was posted in Beta Development, ESBPCS and tagged , , , , . Bookmark the permalink.

4 Responses to Delphi Methods for Dates in Ancient Roman Format

  1. Dave says:

    I’ve got the VCL Stats trial package. I don’t see any limits discussed. For example, with the LinReg, number of variables? Rows?

    • esbglenn says:

      This is a little off topic to the Post and the Blog – so I will give a brief response, if you would like more info please email me direct 🙂

      The TESBDbLinReg Component in ESBPCS takes two fields from a Data Source and performs basic Linear Regression Analysis on them – including computing Coefficient of Correlation, Coefficient of Determination, Gradient of the Resultant Line, Y-Intercept of Resultant Line, Covariance, etc…

      • Dave says:

        I do understand the functionality. Just want to know the basic limits – number of rows, number of variables.

        • esbglenn says:

          I did sort of answer that – two fields implies two variables (X and Y), since this is Linear Regression rather than Multiple Regression.

          Number of Rows – as noted these are fields from a DataSource – so however many rows your DataSource can support.

          As requested please take any follow up to email, because this is off topic to this Post 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.