Issue with DateTimeParseException when using STRICT resolver style

后端 未结 2 624
隐瞒了意图╮
隐瞒了意图╮ 2020-12-06 13:59

I am trying to parse a date string using the following pattern: yyMMdd and the STRICT resolver as follows:

DateTimeFormatter format         


        
2条回答
  •  自闭症患者
    2020-12-06 14:29

    The strict resolver requires an era to go with YearOfEra. Change your pattern to use "u" instead of "y" and it will work, ie. "uuMMdd".

提交回复
热议问题