java.text.ParseException: Unparseable date: yyyy-MM-dd HH:mm:ss.SSSSSS

前端 未结 5 897
情话喂你
情话喂你 2020-12-19 06:57

I am getting ParseException for the following code

    String dateStr = \"2011-12-22 10:56:24.389362\";
    String formatStr = \"yyyy-MM-dd HH:m         


        
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-19 08:00

    'S' is for millisecond. There are 1000 (0 to 999) milliseconds in a second. 389362 is greater than 999. The extra 389000 milliseconds are getting converted to 389 seconds, or 6 minutes 29 seconds and added to the time.

提交回复
热议问题