Why does this SimpleDataFormat parsing fail on Android?

前端 未结 2 2089
梦毁少年i
梦毁少年i 2021-01-13 06:38
DateFormat sdf = new SimpleDateFormat(\"EEE MMM d HH:mm:ss z yyyy\");

sdf.parse(\"Sun Dec 13 10:00:00 UTC 2009\")

result

ja

2条回答
  •  半阙折子戏
    2021-01-13 07:35

    Your format looks correct. Is it possible that you are not using an English Locale though? The formatter will take your system locale and this could result in different names for 'sun' and 'dec'

提交回复
热议问题