Convert from String to Date throws Unparseable date exception [duplicate]

蓝咒 提交于 2019-12-02 01:05:43

Probably your default locale doesn't support English months in MMM. For example in Poland MMM supports "styczeń" but not "Jan" or "January"

To change this In SimpleDateFormat you need to set locale which supports months written in English, for example

new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!