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

前端 未结 5 898
情话喂你
情话喂你 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 07:43

    Use toISOString('HH:mm:ss.S') to get milliseconds (3 digits), then complete as you need with 0.

    For example:

    new Date().toISOString('HH:mm:ss.S')
    

    returns "2012-02-10T12:16:39.124Z"

提交回复
热议问题