You can't parse a date string into LocalDateTime without a time.
LocalDateTime.parse("2019-10-25", DateTimeFormatter.ofPattern("yyyy-MM-dd"))
You should parse the string into LocalDate
and call LocalDate.atStartOfDay()
to return LocalDateTime
with time 00:00:00
.
LocalDate.parse("2019-10-25", DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay()