Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8193938

Support for UTC Zones with TimeZone.getTimeZone()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 17, 21
    • core-libs
    • None

      The following piece of code should return true.

      > LocalDateTime ldt = LocalDateTime.parse("2017-01-01T00:00:00");
      > ZonedDateTime dt1 = ZonedDateTime.of(ldt, ZoneId.of("GMT+10"));
      > ZonedDateTime dt2 = ZonedDateTime.of(ldt, ZoneId.of("UTC+10"));
      >
      > dt1.equals(dt2) returns true as expected, but with:
      >
      > GregorianCalendar gc1 = GregorianCalendar.from(dt1);
      > GregorianCalendar gc2 = GregorianCalendar.from(dt2);
      >
      > gc1.equals(gc2) returns false.

            naoto Naoto Sato
            naoto Naoto Sato
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: