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

Spelling Error in Short Name for Time-Zone "Europe/Paris": ECT --> CET

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      https://docs.oracle.com/en/java/javase/18/docs/api/java.base/java/time/ZoneId.html#SHORT_IDS
      says in particular
      * ECT - Europe/Paris

      The abbreviation "ECT" should most probably be replaced by "CET" (Central European Time).
      "CET" is not documented but actually working exactly like "Europe/Paris".

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :






      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      "ECT" and "Europe/Paris" are both suitable for java.time.ZoneId.of(String) and
      produce the same time-zone.
      ACTUAL -
      Exception in thread "main" java.time.zone.ZoneRulesException: Unknown time-zone ID: ECT

      But ZoneId.of("Europe/Paris") and ZoneId.of("CET") are working as expected.



      ---------- BEGIN SOURCE ----------
      LocalDateTime.parse( "2022-06-30 12:34:56" ).atZone( ZoneId.of("Europe/Paris") ); // ok
      LocalDateTime.parse( "2022-06-30 12:34:56" ).atZone( ZoneId.of("ECT") ); // ERROR
      LocalDateTime.parse( "2022-06-30 12:34:56" ).atZone( ZoneId.of("CET") ); // ok

      (The result should be "2022-06-30 10:34:56").
      ---------- END SOURCE ----------

            naoto Naoto Sato
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: