I'm using Java 8 on linux with the following code
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyMMDD",Locale.ENGLISH);
LocalDate exampleDate = LocalDate.parse(myDate, formatter);
where myDate
is a String equal to "150520". I'm getting error:
java.time.format.DateTimeParseException: Text '150520' could not
be parsed: Conflict found: Field MonthOfYear 1 differs from
MonthOfYear 5 derived from 2015-01-20
I'd like to return May 20, 2015
for example. Any idea what's wrong?
UPDATE
Replacing the date code D
with d
eliminates this error. How to format into readable date?