[Solved] Convert string date to date object Java [duplicate]


You can try something like this:

String str = "Saturday 17th March 2018";
DateFormat format = new SimpleDateFormat("EEE dd MMM yyyy" , Locale.ENGLISH);

System.out.println(format.parse(str.replaceAll("(?<=\\d)(st|nd|rd|th)", "")));

1

solved Convert string date to date object Java [duplicate]