获取指定日期:上个月的最后一天
public static Date endOfLastMonth(Date date) {Calendar cal = setCalendarTime(date);cal.add(Calendar.MONTH, -1);cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));return cal.getTime();}
获取指定日期:这个月的最后一天
public static Date endOfThisMonth(Date date) {Calendar cal = setCalendarTime(date);cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));return cal.getTime();}
获取指定日期:下个月的最后一天
public static Date endOfNextMonth(Date date) {Calendar cal = setCalendarTime(date);cal.add(Calendar.MONTH, 2);cal.set(Calendar.DATE, 0);return cal.getTime();}