我使用此DateTimeFormatter:解析字符串本地日期不使用所需世紀
DateTimeFormatter.ofPattern("ddMMYY")
我想解析字符串150790
,我得到這個錯誤:
Unable to obtain LocalDate from TemporalAccessor: {DayOfMonth=15, MonthOfYear=7, WeekBasedYear[WeekFields[MONDAY,4]]=2090},ISO of type java.time.format.Parsed
很顯然,我想獲得以下TemporalAccessor
:
{DayOfMonth=15, MonthOfYear=7, WeekBasedYear=1990}
你知道我爲什麼得到了209年而不是1990年?
感謝您的幫助