//将日历上翻1个月 返回日期
public static Date lastMonthTime(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.roll(Calendar.MONTH, false);
return cal.getTime();
}
//将日历上翻1个月 返回日期
public static Date lastWeekTime(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.roll(Calendar.WEEK_OF_MONTH, false);
return cal.getTime();
}
public static Date lastMonthTime(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.roll(Calendar.MONTH, false);
return cal.getTime();
}
//将日历上翻1个月 返回日期
public static Date lastWeekTime(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.roll(Calendar.WEEK_OF_MONTH, false);
return cal.getTime();
}