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

Introduce method in TimeZone to provide modern identifier name

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • tbd
    • None
    • core-libs
    • None

      Currently in java.util.TimeZone a user can call TimeZone.getAvailableIDs() which returns 600+ identifiers at the moment. Although all the results are technically valid, the results contain the deprecated 3-letter Java identifiers, as well as historical tzdb identifiers that exist for compatibility reasons, which are ultimately mapped to a modern identifier. For example, 'Japan' is mapped to 'Asia/Tokyo' (Pre-1993 naming conventions), 'Mexico/General' is mapped to 'America/Mexico_City' (Pre-2013 practice), etc.

      For users without compatibility concerns, they should be encouraged to use modern tzdb identifiers in their applications.

      This issue proposes adding the static method getModernIdentifier(String ID) which takes an identifier, and returns the modern equivalent if applicable, otherwise it returns the input ID.

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

              Created:
              Updated:
              Resolved: