需要引用hutool工具包
/**
* 时间区间计算工具类
*/
public class TimeIntervalUtil {
/**
* 昨天时间上限
* @return Date
*/
public static Date getYesterdayMax() throws ParseException {
return DateUtil.endOfDay(DateUtil.yesterday());
}
/**
* 昨天时间下限
* @return Date
*/
public static Date getYesterdayMin() throws ParseException {
return DateUtil.beginOfDay(DateUtil.yesterday());
}
/**
* 今天时间上限
* @return Date
*/
public static Date getTodayMax() throws ParseException {
return DateUtil.endOfDay(new Date());
}
/**
* 今天时间下限
* @return Date
*/
public