SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy/MM");String dyear="2013"; String dmouth="10";Calendar rightNow = Calendar.getInstance();try{ rightNow.setTime(simpleDate.parse(dyear+"/"+dmouth));}catch(ParseException e){ e.printStackTrace();}int days = rightNow.getActualMaximum(Calendar.DAY_OF_MONTH);//根据年月 获取月份天数