You could use regular expressions to get date from a
string and set a date with the results. This gives you more flexability as to what formats you can match, and stops you running into ParseExceptions. However, if you don't restrict the formats your application can support, you will always run into problems. For example 6/7/05 - is that the 6th of July 2005 or the 7th of June 2005?