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

Clarify Three-letter time zone IDs in java.util.TimeZone

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 22
    • core-libs
    • None
    • behavioral
    • minimal
    • Update spec of java.util.TimeZone to fully define deprecated IDS.
    • Java API
    • SE

      Summary

      Link the full list of deprecated 3-letter IDs in java.util.TimeZone.

      Problem

      java.util.TimeZone states that there are deprecated 3-letter IDs, but does not actually define all of them in the class specification. Since they are not defined, one may try to filter out the 3-letter IDs themselves. The full list should be explicitly defined.

      Solution

      Link to the full list in java.time.ZoneId.

      Specification

      --- a/src/java.base/share/classes/java/util/TimeZone.java
      +++ b/src/java.base/share/classes/java/util/TimeZone.java
        * For compatibility with JDK 1.1.x, some other three-letter time zone IDs
        * (such as "PST", "CTT", "AST") are also supported. However, <strong>their
        * use is deprecated</strong> because the same abbreviation is often used
        * for multiple time zones (for example, "CST" could be U.S. "Central Standard
        * Time" and "China Standard Time"), and the Java platform can then only
      - * recognize one of them.
      + * recognize one of them. The full list of deprecated three-letter time
      + * zone IDs and their mappings can be viewed at {@link java.time.ZoneId#SHORT_IDS}.

            jlu Justin Lu
            jlu Justin Lu
            Naoto Sato
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: