*
The moose likes Java in General and the fly likes get the currrent month, bug Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "get the currrent month, bug" Watch "get the currrent month, bug" New topic
Author

get the currrent month, bug

Claudia Vaz
Ranch Hand

Joined: Nov 13, 2001
Posts: 44
Hi
I'm trying to get the current month with the method "getMonth" of the class "Calendar" but it does not work properly.
For example:
We are in November (month 11) and it replys 10 which is October.
Does anyone know what is the problem?
Thanks
Claudia
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

No problem with the API, check out the documantation. http://java.sun.com/j2se/1.3/docs/api/java/util/Calendar.html .
The month list is zero-based like arrays.
Dave.
[This message has been edited by David O'Meara (edited November 23, 2001).]
Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
The months are zero based.
Dale

------------------
By failing to prepare, you are preparing to fail.
Benjamin Franklin (1706 - 1790)


By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get the currrent month, bug