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

bugs in Date class, method java.util.Date.parse()

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Not verified

      Description

      The expression

      new java.util.Date("6/22/96 12:15PM").toString()

      throws an IllegalArgumentException. This is unfortunate.
      If a space is added:

      new java.util.Date("6/22/96 12:15 PM").toString()

      the result is "Tue Jul 23 00:15:00 EDT 1996"

      which has TWO mistakes in it: it has "Jul" instead of "Jun",
      and it has advanced 12:15 PM to be 12:15 AM on the following day!

      And if we try "AM":

      new java.util.Date("6/22/96 12:15 AM").toString()

      the result is "Mon Jul 22 12:15:00 EDT 1996"

      which is also twelve hours later than it is supposed to be.

        Attachments

          Activity

            People

            Assignee:
            duke J. Duke (Inactive)
            Reporter:
            mchansunw Mei Chan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: