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

Incorrect documentation for DateTimeFormatter letter 'k'

    Details

    • Subcomponent:
    • Resolved In Build:
      b152
    • Verification:
      Not verified

      Description

      FULL PRODUCT VERSION :
      Not Applicable

      ADDITIONAL OS VERSION INFORMATION :
      Not Applicable

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Not Applicable

      A DESCRIPTION OF THE PROBLEM :
      In the documentation for DateTimeFormatter there is a table listing the pattern letters and their meaning. Part of it is:

       * a am-pm-of-day text PM
       * h clock-hour-of-am-pm (1-12) number 12
       * K hour-of-am-pm (0-11) number 0
       * k clock-hour-of-am-pm (1-24) number 0

      If you look, 'h' and 'k' have the same "clock-hour-of-am-pm" meaning listed, but I believe 'k' should be clock-hour-of-day instead.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Not Applicable

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Not Applicable
      ACTUAL -
      Not Applicable

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Not Applicable

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Not Applicable
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Not Applicable

        Activity

        Show
        psonal Pallavi Sonal added a comment - https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html http://download.java.net/java/jdk9/docs/api/java/time/format/DateTimeFormatter.html The submitter's observation looks correct, 'k' should be clock hour of day (1-24) .
        Hide
        rriggs Roger Riggs added a comment -
        The same doc error occurs in java.time.format.DateTimeFormatterBuilder.appendPattern() line 1494 or thereabouts.
        Show
        rriggs Roger Riggs added a comment - The same doc error occurs in java.time.format.DateTimeFormatterBuilder.appendPattern() line 1494 or thereabouts.
        Hide
        aroy Abhijit Roy (Inactive) added a comment -
        [~rriggs] I have corrected it and besides this correction, I have made another correction, "F day-of-week-in-month number 3" in DateTimeFormatterBuilder.
        Show
        aroy Abhijit Roy (Inactive) added a comment - [~rriggs] I have corrected it and besides this correction, I have made another correction, "F day-of-week-in-month number 3" in DateTimeFormatterBuilder.
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/0dd710e3934e
        User: rriggs
        Date: 2017-01-05 20:58:02 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/0dd710e3934e User: rriggs Date: 2017-01-05 20:58:02 +0000
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/0dd710e3934e
        User: lana
        Date: 2017-01-11 20:48:03 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/0dd710e3934e User: lana Date: 2017-01-11 20:48:03 +0000

          People

          • Assignee:
            aroy Abhijit Roy (Inactive)
            Reporter:
            webbuggrp Webbug Group
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: