I need to store dates in SharePoint that need to go back around 5000 BC. Ideally, I would like to be able to do date addition/subtraction, like this:
oldDate = '5000 BC';
newDate = '1995 AD';
DateDiff(oldDate, newDate, 'Years'); // equals 6995
How should I proceed? Build an old_date class based on strings? Just use regular dates, but add an AD or BC that makes the date negative?
I ended up storing dates as a text field in ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sTZDYou don’t have to store the entire string, for instance if you wanted to store 5000 BC, you would enter
-5000-01-01. I don’t get my date addition and subtraction very easily, but it was much easier to get the data in there in the format I wanted.