I want to transforme a string to a date, so what i did is :
// x is my string
DateFormat myDateFormat = new SimpleDateFormat("yyyyMMdd");
java.util. date myDate = myDateFormat.parse(x);
It worked fine until I entered a invalid date. ex x = 20039999
That date was transform to 20120607. It's a valid date, BUT not the one that I entered.
Is there a way to thow a exception if the date enter ( x ) is incorrect
Thanks in advance