0

I am giving 1999-12-12 as input of type date in the soap request. I deployed the webservice in IBM JAXRPC. In the request object, i am getting as Calendar object. If the get the Month of the input using Calendar.Month, i am getting 11 as month value. But my month value is 12.

Please tell me why i am getting the value as 11 not 12.

Manoj
  • 5,707
  • 19
  • 56
  • 86
  • possible duplicate of [Why is January month 0 in Java Calendar?](http://stackoverflow.com/questions/344380/why-is-january-month-0-in-java-calendar) – McDowell Dec 27 '11 at 15:05

1 Answers1

1

Months in a Calendar object are 0-indexed, meaning January would be 0 and December would be 11.

From the docs:

MONTH

public static final int MONTH

Field number for get and set indicating the month. This is a calendar-specific value. The first month of the year is JANUARY which is 0; the last depends on the number of months in a year.

Community
  • 1
  • 1
jprofitt
  • 10,874
  • 4
  • 36
  • 46