troubleshooting Question

Having problem with Calendar

Avatar of sunshine737
sunshine737 asked on
Java
3 Comments1 Solution267 ViewsLast Modified:
Hello,

I am setting the 2006/12/01 (YYYY/MM/DD) to the Calendar. When i retrieve the data i am getting 2007/00/01(YYYY/MM/DD).  I am getting the wrong month and year. I am getting this problem only for 12th month in any year. Please suggest me one good way. I used the following code for this.

I am using the Calendar object to set the date, moth and year.
Calendar calendar = Calendar.getInstance();
calendar.set(date.aYear, date.aMonth, date.aDay);

I am getting that data like below.
calendar.get(Calendar.YEAR);
calendar.get(Calendar.MONTH);
calendar.get(Calendar.DATE);


Thanks in advance.


ASKER CERTIFIED SOLUTION
Mick Barry
Java Developer
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros