Android parse String to Date - unknown pattern character 'X'

前端 未结 13 1051
耶瑟儿~
耶瑟儿~ 2021-01-31 07:32

I have Service fetch date string from web and then I want to pare it to Date object. But somehow application crashes. This is my string that I\'m parsi

13条回答
  •  天涯浪人
    2021-01-31 08:05

    The error is saying that simpleDateFormat does not recognize the character X. If you are looking for milliseconds it is represented with the character S.

    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
    

提交回复
热议问题