SimpleDateFormat “Unparseable date” Exception

后端 未结 8 1773
再見小時候
再見小時候 2020-12-20 16:55

I am trying to parse datetime string with SimpleDateFormat.parse() but I keep receiving Unparseable date exceptions.

Here is the date format I am trying

8条回答
  •  春和景丽
    2020-12-20 17:48

    I'd strongly recommend using JodaTime for this sort of thing.

    You're trying to parse an ISO Date format, and Joda does that 'out of the box', and will give you plenty of other benefits too.

    I long ago gave up trying to get the standard JDK data classes to do helpful things.

提交回复
热议问题