How to parse this date string in java
"2020-06-12T00:00:00.000+00:00"
I tried the following code :
public static String convertToStandardDateString(String date) {
// 2020-06-12T00:00:00.000+00:00
String resDate = null;
try {
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'+'X");
Date parsedDate = sdf.parse(date);
resDate = sdf.format(parsedDate);
} catch (Exception e) {
}
return resDate;
}
I am getting the ParsingException
with the above code.