/** * 计算大小月 * @return */ public static String calDate(String date){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); Calendar days = Calendar.getInstance(); try { days.setTime(sdf.parse(date)); } catch (ParseException e) { e.printStackTrace(); } int resultDays = days.getActualMaximum(Calendar.DAY_OF_MONTH); return Integer.valueOf(resultDays).toString(); }