I have a date string inside of a json that I need to parse but I cant get it to work. My date string looks like this : 2018-04-06T10:22:47.643271+02:00
Here is a snippet of the code that parses the date. However this throws an exception java.text.ParseException: Unparseable date: "2018-04-06T10:22:47.643271+02:00"
So far I was able to find that Java does not support fractions of milliseconds, is that really the case here or do I have the format string wrong? Side note I cant change the API response to more palatable date string for java.
Record lastRecord = new Record();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.US);
lastRecord.Time = format.parse(lastStateJson.getString("time"));