What is the difference between ZoneOffset.UTC and ZoneId.of(“UTC”)?

Why does

ZonedDateTime now = ZonedDateTime.now();
System.out.println(now.withZoneSameInstant(ZoneOffset.UTC)
        .equals(now.withZoneSameInstant(ZoneId.of("UTC"))));

print out false?

I would expect the both ZonedDateTime instances to be equal.

1 Answer
1

Leave a Comment