I have date string like Tuesday , December 25th, 1900, how can I covnert it into MM/dd/yyyy format. I have refereed this link but with a workaround for my date format.
Below is what I tried but I'm getting an exception as Unparsable date
.
String caseDate = "Tuesday , December 25th, 1900";
SimpleDateFormat inputFormat = new SimpleDateFormat("EEEE, MMMM dd Z yyyy");
Date date = inputFormat.parse(caseDate);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = formatter.format(date);
Utils.logtMsg("formattedDate "+formattedDate);
Exception as
Exception ::: Unparseable date: " Tuesday , December 25th, 1900"