DateTimeParseException: Unable to obtain LocalDateTime from TemporalAccessor

December 27, 2019

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()
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.