Hi all,
I was trying to deal with dates that can come from many (any ?) origins.
The first thing to do is to standardize the field separator (to ‘-’)
Next, is to add an eventual leading zero.
Here a decision have to be done: do fields with only one digits are only Days and / or Months ?
My answer is Yes ! I never saw a year number set using a single digit (for 1900 to 1909 / 2000 to 2009 as examples).
Then, I have to determine the order of appearance of the Day, Month and Year fields: not tested yet, but done.
And now the importand part: How to deal with the century ?
The case is, people use only two digits for the century # (They never heard of
the bug of the century in WIndows
).
Until now, my position was: a year tha have a value: current year + 2 is in the previous century. this year and next year are from the current century.
So, I insert 19 or 20 following that rule (before the two digits of the short year # to get a date with the Century).
What is your position ?
(How do you deal with that ?).
Edit: What I call Century above is in fact the Millenium + Century numbers (19 or 20).
BTW: ParseDate is useless here.
The target date format is SQL Date (YYYY-MM-DD)
Nota: this is for the cases the user import (a file or by a Copy / Paste) data without the century set for the year #.
If the user have to write its own date, there are solutions to avoid 2 digit years and depending on the context, avoid “strange” year numbers (like some living person whose birth year is set to 1848 (for example).
The date of abolition of slavery in France is 27 April 1848. Someone may enter 1848 for a Date of Birth instead of 1948 (because s/he was working on an article about slavery in France
).