Results 1 to 4 of 4
  1. #1
    OlegKo is offline Member
    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

    Default Calendar class issue

    I have the following line in the code:

    int mmNow = Calendar.getInstance().get(Calendar.MONTH);

    while debugging, I can see it is set to 9 not 10. How is that possible? Day and year show correct values of 24 and 2010....

    System date is set correctly. Here is what I am getting in the shell:

    C:\Documents and Settings\>date
    The current date is: Sun 10/24/2010

    Thanks!

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    5

    Default

    It is to hard for you to read the API Doc? :eek:
    MONTH
    "The first month of the year in the Gregorian and Julian calendars is JANUARY which is 0"

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  4. #4
    OlegKo is offline Member
    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

    Default

    Wow. Would never guess it works like that. Thanks for the tip!

Similar Threads

  1. plz help me with this class, calendar
    By hamed in forum New To Java
    Replies: 6
    Last Post: 09-06-2010, 10:58 PM
  2. Calendar Pop-up issue
    By jeeva in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 01-29-2009, 01:09 AM
  3. Issue in calendar display
    By jeeva in forum New To Java
    Replies: 1
    Last Post: 01-14-2009, 01:19 PM
  4. How to use Calendar class
    By JavaBean in forum Java Tip
    Replies: 1
    Last Post: 06-26-2008, 03:09 PM
  5. Gregorian calendar issue
    By orchid in forum New To Java
    Replies: 1
    Last Post: 05-16-2007, 06:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •