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

Date.setDate() does not recalc day of week, all platforms

    XMLWordPrintable

    Details

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

      Description

      java.util.Date.setDate() method does not recalc the day of the week

      Steps to reproduce:
      Compile and run the following code:

      /* Tests Date accounting
       * Kevin Smith
       */

      import java.util.Date;

      public class BadDate
      {
         static public void main(String args[])
         {
            int i;
            int startDate = 27;
            int startMonth = 11;
            int startYear = 95;
            Date date = new Date(startYear, startMonth, startDate);

            // iterate through suspect dates
            for(i = 0; i < 8; ++i)
            {
               date.setDate(date.getDate() + 1);
               System.out.println(date);
            } // end for

         } // end main()

      }

        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: