我收到此错误:
java.text.ParseException: Unparseable date: "Fri Apr 08 2016 00:00:00 GMT+0530 (IST)"
我已经使用了这个SimpleDateFormat
,有人可以建议我一个正确的吗?
SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss z (Z)");
最佳答案
如果您的喂食日期为“Fri Apr 08 2016 00:00:00 GMT+0530 (IST)”。那么就错了。请删除 GMT。所有时区均仅从 GMT 开始计算。
尝试将日期传递为“Fri Apr 08 2016 00:00:00 +0530 (IST)”。它会起作用的。
关于java - SimpleDateFormat解析错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36498530/