Issues with Historical Dates (pre-1900)

01-22-2020 12:32 PM
New Contributor II

Recently, I discovered a sneaky sorting bug for date/time values before 1900 30 December 1899 in date fields (ArcGIS Pro 2.4.3). The dates sort correctly but the times do not (see screenshots below). It also seems to cause features to drop when time is enabled for the feature layer and the time-span is set to hours or smaller.

I'm working with my organization to submit a bug report, but hopefully, by posting here, it will save some headaches for the next person who encounters this issue (or at least help to troubleshoot why order-dependent python scripts in the Calculate Field geoprocessing tool are failing).

   correct sort:

   incorrect sort:

   incorrect sort:

The work-around is to split year, month, day, and time into separate fields and use a custom sort, but this still doesn't solve the timeslider issues. Alternatively, if the range of dates is relatively small, shifting them to the 20th/21st century gets around the issue as well (e.g., +100 years), but the day of the week will be wrong.

Based on a few tests, it seems that Arcade might be a culprit for some of the issues. Sorting lists of pre-1900 dates/times stored in a date object (datetime module for python) works as expected. Additionally, features labeled in AGP based on the date field returned the wrong times (red labels in figure below) when using Arcade as the language in the expression builder (Label Class pane), but after I switched the language to python (or VB or js), the labels displayed the correct times (blue labels in figure below).

Has anyone found other issues or strange behavior while using pre-1900 dates/times in AGP date fields? 

Of course AGP isn't the only software to struggle with a y1k9c bug. Issues with historical dates in Excel:

Abandon all hope, ye who enter dates in Excel – UC3 :: California Digital Library

Differences between the 1900 and the 1904 date system - Office | Microsoft Docs 

0 Kudos
0 Replies