Calendar cl = Calendar.getInstance();
int mon=cl.get(Calendar.MONTH)+1;//月份需要+1
cl.set(Calendar.MONTH, mon-1);//同样设置时月份需要-1
//Calendar tcl=cl;会导致后面cl与tcl的值一致
Calendar tcl = (Calendar) cl.clone();
String str = "";
switch (cl.get(Calendar.DAY_OF_WEEK))
{
case 7:
str = "星期六";
break;
case 6:
str = "星期五";
break;
case 5:
str = "星期四";
break;
case 4:
str = "星期三";
break;
case 3:
str = "星期二";
break;
case 2:
str = "星期一";
break;
case 1:
str = "星期日";
break;
}