I'm stuck on a conversion problem from a String to a ZonedDateTime in Java.
I have the following String :
String str = "2019-06-13T09:27:07.233+0000";
that I would like to convert to a ZonedDateTime
. So far I've been trying with and without formatters but I keep getting an error.
Here's my code :
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
return ZonedDateTime.parse(str, formatter);
The error I get is :
Text '2019-06-13T09:27:07.233+0000' could not be parsed at index 23.
I've tried several custom patterns as well as ISO_DATE_TIME
and ISO_OFFSET_DATE_TIME
but none of them worked...
Anyone would have any idea of the correct pattern for this one ?
Thank you !