判断当前时间是否在规定时间期限内
实现优惠券是否在使用期限内的功能
用Calendar实现
//从数据库获取优惠券的使用时间
Date startTime=couponDao.getAll(id).getStartDate();
Date endTime=couponDao.getAll(id).getEndDate();
Date now=new Date();
boolean inDate=inDate(now,startTime,endTime);
//对时间进行判断
原创
2020-11-04 11:01:07 ·
525 阅读 ·
1 评论