I'm using DateTimeFormatter
to parse a date:
private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
LocalDate.parse("05/12/2015", parser); // it's ok
LocalDate.parse("5/12/2015", parser); // Exception
Unfortunately it doesn't parse correctly dates with a single day digit, like "5/12/2015"
.
I read some other post as this but the proposed solution doesn't work for me. I need a way to parse dates that can have single or double digits day.