I have string “Tue Nov 12 2010”,I want to parse it in java.util.Date object.
I write below code for this
DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
Date date= format.parse("Tue Nov 12 2010");
It is giving exception like below:
java.text.ParseException: Unparseable date: "Sun Nov 21 2010"
Not getting what is wrong with it???
The date format you have created
new SimpleDateFormat(“dd/MM/yyyy”);
Will only parse dates of that form. I.e. 05/10/1989
You’ll need to change the format something more appropriate.