If I do
import java.time.Instant;
...
Instant instant = Instant.parse("2018-01-02T18:14:59.000+01:00")
I get this exception:
Caused by: java.time.format.DateTimeParseException: Text '2018-06-19T23:00:00.000+01:00' could not be parsed at index 23
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1777)
But if I do
Instant instant = Instant.parse("2018-06-19T23:00:00.000Z");
All works fine.
What do I miss? Whats wrong with the first time string?
The string must represent a valid instant in UTC
that is probalby the reason your first example doesnt work – Duchamp