给你一个日期2009-01-01 00:00:00 获取这个月的最后一天。
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date=null;
try {
date = sdf.parse("2009-12-01 00:00:00");
} catch (ParseException e) {
e.printStackTrace();
}
Calendar calendar = new GregorianCalendar();
calendar.setTime(date);
calendar.set(Calendar.DATE, calendar
.getActualMaximum(Calendar.DATE));
Date d = calendar.getTime();
System.out.println(sdf.format(d));