I am trying to convert a String to LocalDate using DateTimeFormatter, but I receive an exception:
java.time.format.DateTimeParseException: Text '2021-10-31' could not be parsed at index 5
My code is
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MMM-uuuu");
String text = "2021-10-31";
LocalDate date = LocalDate.parse(text, formatter);
I am trying to convert from input date 2021-10-31 to 31-Oct-2021.