구문 분석 할 수 없습니다 TemporalAccessor에서 OffsetDateTime를 가져올 수 없습니다 :

Nuñito 드 라 칼 자다 :

나는이 코드 조각이 :

public static final String DATE_PATTERN = "yyyy-MM-dd";

    OffsetDateTime.parse(startTime, DateTimeFormatter.ofPattern(DateFormat.DATE_PATTERN)

하지만 구문 분석이 오류가 있습니다 :

java.time.format.DateTimeParseException: Text '2019-07-10' could not be parsed: Unable to obtain OffsetDateTime from TemporalAccessor: {},ISO resolved to 2019-07-10 of type java.time.format.Parsed
데드 풀 :

ZonedDateTime

는 ISO-8601 달력 시스템의 시간대와 날짜 시간, 같은 2007-12-03T10 등 : 15 : 30 + 01 : 00 유럽 / 파리.

LOCALDATE

는 ISO-8601 캘린더 시스템의 시간대없이 날짜 같은 2007년 12월 3일.

당신의 문자열이 단순한 날짜를 나타 내기 때문에, 그래서 사용 LocalDate

LocalDate date = LocalDate.parse(startTime, DateTimeFormatter.ISO_DATE);

추천

출처http://43.154.161.224:23101/article/api/json?id=337222&siteId=1