public Date getTorrowDate(Date today){
int toMonth = today.getMonth()+1;
int toDay =today.getDate();
int toYear = today.getYear();
switch(toMonth){
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:if(toDay==31){if(toYear==12){toMonth=1;toDay=1;}else{toMonth = toMonth+1;toDay=1;}}else{toDay = toDay+1;};break;
case 4:
case 6:
case 9:
case 11:if(toDay==30){toMonth = toMonth +1;toDay=1;}else{toDay = toDay+1;};break;
case 2:if(toDay==28){if(runnian(toYear)){toDay = toDay+1;}else{toDay=1;toMonth=toMonth+1;}}else{toDay = toDay+1;};break;
default:break;
}
return new Date(toYear,toMonth-1,toDay);
}
public boolean runnian(int year){
if((year%4==0&&year%100!=0)||year%400==0){
return true;
}else{
return false;
}
}
//得到今天日期
public Date getCurrentDate(){
return new Date();
}
public String tool(int month){
if(month<10){
return "0"+month;
}else{
return ""+month;
}
}
public String getWeek(int week){
String[] weeks = new String[]{"星期一","星期二","星期三","星期四","星期五","星期六","星期天"};
switch(week){
case 0:return weeks[6];
case 1:return weeks[0];
case 2:return weeks[1];
case 3:return weeks[2];
case 4:return weeks[3];
case 5:return weeks[4];
case 6:return weeks[5];
}
return null;
}