When running the following code in Java 8, the Instant produced from parsing the String "2021-03-26T23:43:03+01:00[Europe/London]
" is "2021-03-26T23:43:03Z
"
(which afaik is right since in 2021 DST kicked in on March the 28th, so on the 26th London time and UCT should still match)
However, when running the same code in Java >=9, the resulting date is off by one hour: "2021-03-26T22:43:03Z"
Is this a bug, or is there I'm missing on here? I'm relatively new to Java.
public void giveMeDate(){
ZonedDateTime dateTime = ZonedDateTime.parse("2021-03-26T23:43:03+01:00[Europe/London]", DateTimeFormatter.ISO_DATE_TIME);
System.out.println(dateTime.toInstant());
}