1 2 Previous Next 15 Replies Latest reply: May 31, 2007 6:12 AM by 807606 RSS

    java.util.calendar bug?

    807606
      Hello,

      I am having a problem with java.util.calendar. When I try to set the date for 5/31/2007 using the .set method, the get returns 6/1/2007. Other dates work fine. Any ideas would be greatly appreciated. My test code is pasted below:

      fCalendar.set(fCalendar.YEAR, 2007);
      fCalendar.set(fCalendar.MONTH, 05);
      fCalendar.set(fCalendar.DAY_OF_MONTH, 31);
      System.out.println("Date is " + fCalendar.get(fCalendar.MONTH) + "-" +
      fCalendar.get(fCalendar.DAY_OF_MONTH) + "-" +
      fCalendar.get(fCalendar.YEAR));

      Result is: "Date is 6-1-2007"
        1 2 Previous Next