获取当前系统前一天日期
public static Date getYesterday(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, -1);
date = calendar.getTime();
return date;
}
获取当前系统当天日期
public static Date getToday(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, 0);
date = calendar.getTime();
return date;
}
获取当前系统下一天日期
public static Date getNextday(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, 1);
date = calendar.getTime();
return date;
}