Java - Unparseable date

前端 未结 2 760
离开以前
离开以前 2020-11-21 23:44

I am trying to parse a date, but I am oddly getting an exception.

This is the code:

import java.util.Date;

String strDate = \"Wed, 09 Feb 2011 12:3         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 00:18

    It's probably because of the default locale on your computer which is not english.

    You should use:

    new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.ENGLISH);
    

    instead.

提交回复
热议问题