我无法解决问题。我正在尝试将日期字符串解析2013-05-23T19:00:00GMT-00
为 StandardFormat,yyyy-MM-dd'T'HH:mm:ssz
但我总是在第 25 位得到 ParseException。
// Get a human readable format.
DateFormat dateFormat = DateTime.getStandardFormat();
// Subtract a full hour from the time passed in.
final int HOUR_IN_MINUTES = 3600;
DateTime dateTimeLess1Hour = aDateTime.minus(HOUR_IN_MINUTES, 0);
// Convert the DateTime, less exactly one hour, to a string.
String timeLess1String = dateFormat.format(DateTime.toDate(dateTimeLess1Hour));
// Split the string to distinguish the time part
String date = timeLess1String.substring(0, 10);
String time = timeLess1String.substring(11);
String[] hhMMss = time.split(":");
String hourOnHourDate = date + "T" + hhMMss[0] + ":00:00" + hhMMss[2].substring(2);
Date inDateFormat = null;
// Convert the string into a Date object
inDateFormat = dateFormat.parse(hourOnHourDate);
// Convert the Date into a DateTime object.
return new DateTime(inDateFormat);
错误消息说 Unparseable date: 2013-05-23T19:00:00GMT-00