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

Problem with timezone in a SimpleDateFormat

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b25
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        SHORT SUMMARY: Inaccurate date reports when using yyyy/MM/dd HH:mm:ss.S z
        date format on a Timezone with historical TZ rules
        INDICATORS: Can occur when parsing date strings with TimeZone included, the
        "z" element.
        COUNTER INDICATORS:
        TRIGGERS:
        SimpleDateFormat class can incorrectly calculate a DST offset when parsing
        date strings that contain the TimeZone. If the parsed TZ has used different
        rules over past years, then the hour offset from the DST calculation may be
        incorrect. In general, applications shouldn't rely on time zone abbreviations
        for parsing of date strings. e.g CST can represent different timezones across
        the globe.

        KNOWN WORKAROUND: Don't use timezone abbreviations in timezones strings that
        are to be parsed. Perhaps store the timezone separately.
        PRESENT SINCE: N/A
        HOW TO VERIFY:
        NOTES FOR SE: Dev engineer has proposed some changes to correct this. It
        should first be ported to JDK 8 and baked/tested there for compatibility
        behaviour. Once satisfied, we can port it to a JDK 6 update release.

        REGRESSION:

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                okutsu Masayoshi Okutsu
                Reporter:
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: