我正在尝试解析“updated_time”并尝试将其转换为 Date() 对象。但我得到以下异常。
java.text.ParseException: Unparseable date: "2015-10-11T07:21:14+0000"
这是我的代码。
private Date convertStringToDate(String createdAt) {
Date convertedDate = new Date();
try {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
convertedDate = formatter.parse(createdAt);
} catch (ParseException e) {
Log.e(TAG, "parse exception while converting string to date for facebook : "+e.toString());
}
return convertedDate;
}
我用谷歌搜索但没有找到那么多..