今天测出了个bug,是在列表查询时时间段查询无法查询到结束日期当天的数据,发现是因为用了between and的问题,现在说下解决方案。
public static Date getTomorrow(Date date){
Calendar calendar = Calendar.getInstance(); //得到日历
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, 1); //设置为后一天
Date tomorrow = calendar.getTime(); //得到后一天的时间
return tomorrow;
}
这样即可解决解决between and不包含有边界问题了