For example:
A user can enter 01/23/1983 or 1/23/1983
How would I use DateFormat to write up two different kinds of formats like (MM/DD/YYYY) and (M/DD/YYYY) and compare them to the actual date to see which one matches the date so I could parse it successfully?
Because Johan posted an incorrect solution, I feel obliged to post the correct one.
"MM/dd/yyyy"will format both of your test Strings: