Can’t parse String to LocalDate (Java 8)

For year you have to use the lowercase y:

final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("dd-MM-yyyy");

Uppercase Y is used for weekyear. See the javadoc of DateTimeFormatter for more details.

Leave a Comment