• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get the currrent month, bug

 
Claudia Vaz
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The months are zero based.
Dale

------------------
By failing to prepare, you are preparing to fail.
Benjamin Franklin (1706 - 1790)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic