9
Không thể có được LocalDateTime từ TemporalAccessor khi phân tích cú pháp LocalDateTime (Java 8)
Tôi chỉ đơn giản là cố gắng chuyển đổi một chuỗi ngày thành một đối tượng DateTime trong Java 8. Khi chạy các dòng sau: DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); LocalDateTime dt = LocalDateTime.parse("20140218", formatter); Tôi nhận được lỗi sau đây: Exception in thread "main" java.time.format.DateTimeParseException: Text '20140218' could not be …