1. 程式人生 > >按照日期查詢最近7天,一個月功能

按照日期查詢最近7天,一個月功能

spa color get class cnblogs gte else 日期查詢 pan

     if ("30".equals(date)) {
             Calendar now = Calendar.getInstance();      
             now.setTime(new Date());      
             now.set(Calendar.DATE, now.get(Calendar.DATE) - 30);              
             param.addParam("addtime", Operator.GTE , now.getTime());
        }else if ("90".equals(date)) {
            Calendar now 
= Calendar.getInstance(); now.setTime(new Date()); now.set(Calendar.DATE, now.get(Calendar.DATE) - 90); param.addParam("addtime", Operator.GTE , now.getTime()); }else if ("180".equals(date)) { Calendar now = Calendar.getInstance(); now.setTime(
new Date()); now.set(Calendar.DATE, now.get(Calendar.DATE) - 180); param.addParam("addtime", Operator.GTE ,now.getTime()); }else if ("7".equals(date)) { Calendar now = Calendar.getInstance(); now.setTime(new Date()); now.set(Calendar.DATE, now.get(Calendar.DATE)
- 7); System.out.println(now.getTime()); param.addParam("addtime", Operator.GTE , now.getTime()); }

按照日期查詢最近7天,一個月功能