The current string input for DateObject[] has a number of issues:
First, if you try to enter a first century date, the result is a twentieth century date. So if you enter the traditional date for the destruction of Pompeii by Vesuvius, you get the wrong result:
In[2]:= DateObject["8/23/79"]
Out[2]= DateObject[{1979, 8, 23}, "Day", "Gregorian", -4.]
Second, the most popular date format is ambiguous: depending on the user's location, the order could be month/day/year or day/month/year. There is no way to specify the order beforehand:
Third, if the user wants to make a date object out of a century, such as "16th Century", DateObject[] does not work at all. Instead, you must use Interpreter[], which does the job but which requires an internet connection and can be very slow.
Fourth, when entering historical dates, the calendar type is assumed to be that which was in place at the time and location of the event. Thus, the date of the start of the Great Fire of London is given as September 2, 1666, which is understood to be a Julian Calendar date, since this calendar was in use in London at the time. Certainly, the date of the battle of Agincourt, 10/25/1415, is understood to be a Julian calendar date, since the Gregorian calendar was not introduced until 1582. However, DateObject[] assumes that both these dates are given for the Gregorian calendar [LongDash] the default is not even shown in the pod.
These issues render this function problematic for anyone who wants to rely on string input for the function, which is most people who might want to do historical research. (These issues are mostly moot for dates from the 19th century or later.)
I have made a package that fixes these problems:
Any date that is entered with a year prior to 1582 will be assumed to be a date in the Julian Calendar.
There will be a variable to specify the adoption year of the Gregorian calendar. This will default to 1582. The user can set this to the year for the country they are working with, such as 1752 for England and colonies.
Dates with a two-digit year will be interpreted properly, as occurring in the first century
Century specifications, such as 'XVI century' or 'Fourth Century BCE' will be interpreted properly.
'Trecento' and similar terms used in Italian Cultural History will be properly interpreted.
AD, BC, CE, and BCE will all work.
O.S. and N.S. (and variants) will work to designate Calendar type.
The package is attached to this post. A fuller explanation is provided in the other document.
It is my hope that this functionality will eventually make its way into Wolfram Language, replacing the existing string parser for the function. Other than not allowing '79' as a shortcut for '1979', the functionality in the package would have no effect on the typical usage for recent dates, and dates using proleptic Gregorian calendar (or Julian Dates) for astronomical computations.
Feedback is welcomed.
Thanks.
Attachments: