I am trying to parse the following string with LocalDate: "04 Aug 2015".
After trying a few variation of DateTimeFormatters, I looked for answers in SO and found out that some of the parsing examples given in answer did not work for me. After further investigation I have found out that java 14 fails to parse a date which include a string month such as "Jul", "Feb"... but in java 8 & 10 it worked flawlessly.
The Exception thrown was:
java.time.format.DateTimeParseException: Text '04 Aug 2015' could not be parsed at index 3
Have there been any changes to LocalDate/DateTimeFormatter in java 14? I could not find anything in the documentation.
Here is the code that prints successfully on java 8/10 and throws a DateTimeParseException at java 14:
public static void main(String[] args) {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd MMM yyyy");
String anotherDate = "04 Aug 2015";
LocalDate lds = LocalDate.parse(anotherDate, dtf);
System.out.println(anotherDate + " , " + lds);
}