Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

why month in calendar and date is zero based ?

prateekazamApr 3 2011 — edited Apr 3 2011
suppose i am getting the date from the GUI .after that i just want to take only month from the Date Object .the code is following

Date date=(Date)dateValue.getValue();

when i get the month by using date.getMonth() it return one less from the actual month why ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2011
Added on Apr 3 2011
8 comments
1,102 views