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

util.Date.setMonth() should wrap around end of year

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      x86
    • OS:
      windows_nt
    • Verification:
      Not verified

      Description

      java.util.Date.setMonth() should wrap around end of year.

      Steps to reproduce:
      Compile and run the following code

      // tests setMonth()

      import java.util.Date;

      class setMonthTest
      {
          public static void main(String args[])
          {
             Date d1 = new Date(95, 10, 21);
             System.out.println("Date " + d1);
             d1.setMonth(11);
             System.out.println("Date changed to Thu Dec 21 1995: " + d1);

             d1.setMonth(12);
             System.out.println("Date wrapped to Sun Jan 21 1996: " + d1);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              duke J. Duke (Inactive)
              Reporter:
              kasmithsunw Kevin Smith (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: