Link to home
Start Free TrialLog in
Avatar of applekanna
applekanna

asked on

CAlendar in java

HI
Calendar c = Calendar.getInstance();
System.out.println("month and year is " + c.MONTH+ "      "+c.YEAR );

gives me
month and year is 2      1

y?

Thx


       
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of applekanna
applekanna

ASKER

I want toget 11 and 2003
Watch out for the strange thing about months.  They're numbered 0 .. 11 (not 1 .. 12) ;-)
> I want toget 11 and 2003

System.out.println("month and year is " + (c.get(Calendar.MONTH)+1)+ "      "+c.get(Calendar.YEAR) );
Thx for you qwik help
;-)
8-)