public int getMonthDay(String year,String month){
String source = year+"年"+month+"月";
int count=30;
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月");
try {
Date date = format.parse(source);
Calendar calendar = new GregorianCalendar();
calendar.setTime(date);
count=calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
}catch (Exception e) {
e.printStackTrace();
}
return count;
}
String source = year+"年"+month+"月";
int count=30;
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月");
try {
Date date = format.parse(source);
Calendar calendar = new GregorianCalendar();
calendar.setTime(date);
count=calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
}catch (Exception e) {
e.printStackTrace();
}
return count;
}