I looked similar topics but it didn't help me. I have ISO-8601 date type, for example: 2014-08-13T19:05:22.168083+00:00
.
I try to parse it so:
public static Date parseISO8601(final String date) {
String fixedDate = date.replaceFirst("(\\d\\d[\\.,]\\d{3})\\d+", "$1");
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.ENGLISH);
try {
return df.parse(fixedDate);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
but it throws exception. And I cannot understand why?
Error message: java.text.ParseException: Unparseable date: "2014-08-13T19:05:22.148+00:00"