java.text.ParseException: unparsable date: “Mon, 22 Aug 2005 20:21:52 +0200”

前端 未结 1 1911
渐次进展
渐次进展 2021-01-23 17:47

I got this error.

What is wrong on my code?

String line = \"Date: Mon, 22 Aug 2005 20:21:52 +0200\";
String datestring = line.substring(6);
DateFormat da         


        
相关标签:
1条回答
  • 2021-01-23 18:04

    Is your system locale something else than English? Try to explicitly specify the locale:

    DateFormat dateFormat = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss ZZZZZ",
            Locale.US);
    
    0 讨论(0)
提交回复
热议问题