有没有办法解析以下日期字符串July 23 1916而不是July 23 2016?
System.out.println(new SimpleDateFormat("yy/MM/dd", Locale.US).parse("16/07/23"));
Run Code Online (Sandbox Code Playgroud) 我正在使用这个DateTimeFormatter:
DateTimeFormatter.ofPattern("ddMMYY")
Run Code Online (Sandbox Code Playgroud)
我想解析字符串150790,我得到了这个错误:
Unable to obtain LocalDate from TemporalAccessor: {DayOfMonth=15, MonthOfYear=7, WeekBasedYear[WeekFields[MONDAY,4]]=2090},ISO of type java.time.format.Parsed
Run Code Online (Sandbox Code Playgroud)
显然,我希望得到以下内容TemporalAccessor:
{DayOfMonth=15, MonthOfYear=7, WeekBasedYear=1990}
Run Code Online (Sandbox Code Playgroud)
你知道我为什么得到2090而不是1990年?
谢谢你的帮助