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

SimpleDateFormat Class bug in examples

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.1, 1.3.0
    • core-libs
    • generic
    • generic



      Name: skT45625 Date: 10/27/2000


      This is a documentation issue and has no source/output.


      Actually this is in the on-line documentation section for v1.2.2.

      On the page documenting the API for the SimpleDateFormat class, I believe
      there is a typo in one of the examples given. The URL is
      http://java.sun.com/products/jdk/1.2/docs/api/java/text/SimpleDateFormat.html

      The documentation states the following formats:

        h hour in am/pm (1~12) (Number) 12
        H hour in day (0~23) (Number) 0

      The first example uses the "hh" format for the hour, yet shows the result as
      "15" not "03".

       Format Pattern Result
       -------------- -------
       "yyyy.MM.dd G 'at' hh:mm:ss z" ->> 1996.07.10 AD at 15:08:56 PDT


      Just thought that I would mention this as examples are a very important part
      of understanding any technical documentation.
      (Review ID: 109501)
      ======================================================================

            nlindenbsunw Norbert Lindenberg (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: