I want to execute a simple example to parse string to date with pattern.
String input = "Sep 31 2013";
LocalDate localDate = LocalDate.parse(input,
DateTimeFormatter.ofPattern("MMM d yyyy"));
It throws exception:
Exception in thread "main" java.time.format.DateTimeParseException: Text 'Sep 31 2013' could not be parsed at index 0
at java.time.format.DateTimeFormatter.parseResolved0(Unknown Source)
at java.time.format.DateTimeFormatter.parse(Unknown Source)
at java.time.LocalDate.parse(Unknown Source)
at lambda.DateTime.main(DateTime.java:78)
I use java.time package from java 8.