728x90 반응형 DateTimeParseException1 [Java] java.time.format.DateTimeParseException: Text 'yyyyMMdd' could not be parsed: Unable to obtain LocalDateTime from TemporalAccessor: {},ISO resolved to yyyy-MM-dd of type java.time.format.Parsed LocalDateTime.parse("20220720", DateTimeFormatter.ofPattern("yyyyMMdd")); java.time.format.DateTimeParseException: Text '20220720' could not be parsed: Unable to obtain LocalDateTime from TemporalAccessor: {},ISO resolved to 2022-07-20 of type java.time.format.Parsed 위 코드를 실행 시 DateTimeParseException 이 발생하는 이유는 자바가 Base Date 값을 DateTime으로 허용하지 않기때문입니다. LocalDateTime 대신 LocalDate를 사용하면 문제가 해결됩니다... 2022. 7. 20. 이전 1 다음 728x90 반응형