I have a text box, into which the user has the opportunity of entering a date.

What is the best code to use to:
a) validate to ensure the date is correct
b) translate whatever they have entered into a standard format date.

a) should reject 13/13/2002 etc.
b) should sort out the problems of either 13/12/2002 or 12/13/2002 is valid, but not both.