java.text.ParseException: Unparseable date: “Thu Jan 19 2012 08:00 PM”

后端 未结 5 2209
春和景丽
春和景丽 2020-12-10 16:46

I would like to parse a date. My String date is \"Thu Jan 19 2012 08:00 PM\". And my code to parse is:

format = new SimpleDateFormat(\"EEE MMM dd yyyy hh:mm          


        
5条回答
  •  失恋的感觉
    2020-12-10 17:02

    Try setting a Locale such as US in this case:

    SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy hh:mm aaa",Locale.US);
    format.parse("Thu Jan 19 2012 08:00 PM");
    

提交回复
热议问题