I am curious what would be the best way to handle an ambiguous date string in any given language. When pre-validating your user input isn’t an option, how should MM/dd/YYYY dates be parsed?
How would you parse the following ambiguous date and for what reason (statistical, cultural, etc)?
‘1111900’ as Jan 11, 1900 [M/dd/YYYY] or Nov 1, 1900 [MM/d/YYYY]?
Unless you know exactly what the language/culture the format is coming from, you need to establish a common date format.
There is something called locale-neutral date format that I would recommend. (YYYY-MM-DD)
It’s either use that or be clear as to what part is the year, month and day. (DD MON YYYY or 22 Apr 2003)
See: the w3’s view on date formatting.
Edit: mistyped the locale-neutral date format