Hi..all..

I am new to java,

I want to display previous six months from the current month,i am using th following code
Calendar cal = Calendar.getInstance();

String[] monName = {"January", "February","March", "April", "May", "June", "July",
"August", "September", "October", "November","December"};

String mon1 = monName[cal.get(Calendar.MONTH)];
String mon2 = monName[(cal.get(Calendar.MONTH)-1)];
String mon3 = monName[(cal.get(Calendar.MONTH)-2)];
String mon4 = monName[(cal.get(Calendar.MONTH)-3)];
String mon5 = monName[(cal.get(Calendar.MONTH)-4)];
String mon6 = monName[(cal.get(Calendar.MONTH)-5)];
String mon7 = monName[(cal.get(Calendar.MONTH)-6)];


System.out.println(mon1);
System.out.println(mon2);
System.out.println(mon3);
System.out.println(mon4);
System.out.println(mon5);
System.out.println(mon6);
System.out.println(mon7);

it is working fine in my local machine..
But in the production server,i am not getting the current month as november

i dont know..why..it happens..
can any one..help me