I've a date string like "Jan 11, 2017 2:08:00 AM". I want to convert this string to Date in "dd/MM/yyyy" format. My Code sample is below
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
String dateStr= inSoya.get("selectedDate").toString(); //Jan 11, 2017 2:08:00 AM
Date dd=formatter.parse(dateStr);// Error !
The excepiton is throwen at the last line where I am tring to parse.
Error Message is : Java.text.ParseException: Unparseable date: "Jan 5, 2017 2:08:00 AM"
So what should I do ?