【发布时间】:2013-10-04 11:12:25
【问题描述】:
我正在使用 org.joda.time.DateTime 解析后台日期 (C#) \\/Date\\((\\d+)([-+]\\d+)?\\)\\/
示例:
1 - BO 日期 = /Date(1380891215020+0100)/
2 - DateTime BO 日期解析 = 2013-10-04T12:53:35.020+01:00
3 - Calendar.setTime(DateTime BO 日期解析) = Fri Oct 04 12:53:35 GMT+01:00 2013
4 - 字符串 finalDate = Calendar.getTime().toString(); = 2013 年 10 月 4 日星期五 12:53:35 GMT+01:00
此时一切正常。现在我想进行日期比较:
Date dateA = mySimpleDateFormat.parse(finalDate);
Calendar cal = Calendar.getInstance();
cal.setTime(dateA);
...
当我在某些设备中使用mySimpeDateFormat 解析finalDate 时
java.text.ParseException:无法解析的日期:“Fri Oct 04 12:53:35 WEST 2013" (偏移 20)"
被抛出。 HTC One S 就是其中一种设备。
电话日期和时间设置:
- 自动日期和时间:true
- 自动时区:false
知道为什么有 WEST 而不是 GMT+01:00 吗?
感谢您的宝贵时间。
【问题讨论】:
标签: java android calendar simpledateformat parseexception