Код: Выделить всё
private static final DateTimeFormatter FORMAT = DateTimeFormatter
.ofPattern("yyyyMMdd").withChronology(IsoChronology.INSTANCE)
.withResolverStyle(STRICT);
public static LocalDate parse(String yyyyMMdd) {
return LocalDate.parse(yyyyMMdd, FORMAT);
}
< /code>
Однако анализ действительной даты, такой как «19800228», создает то, что мне является непостижимой ошибкой: < /p>
java.time.format.dateTimeparseExpress: Tempormessesse: Temporcessesser: Ontable Of ontableccesser: ontableccesser: ontablec {Monthofyear = 2, dayofmonth = 28, yearofera = 1982}, iso of type java.time.format.parsed
Как я использую java.time.format.datetimeformatter Подробнее здесь: https://stackoverflow.com/questions/263 ... te-parsing