aspose file tools*
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
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)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: get the currrent month, bug
 
Similar Threads
Trial of Webphere enough for 157?
How long to get the cert?
Why does the month start at 0, and not at 1?
problem: How to get last month date
!SimpleDateFormat