Mazin Ismail
Mazin Ismail

Reputation: 103

LocalDate.parse does not validate leap years

DateTimeFormatter formatters = DateTimeFormatter.ofPattern("uuuu-MM-dd");
endDate = LocalDate.parse(endDateString, formatters);

Why does the above code not throw exceptions for leap years? If you give 2023-02-31, no validation error is thrown.

Upvotes: 1

Views: 88

Answers (0)

Related Questions