按照日期查询最近7天,一个月功能
Posted BINGJJFLY
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了按照日期查询最近7天,一个月功能相关的知识,希望对你有一定的参考价值。
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天,一个月功能的主要内容,如果未能解决你的问题,请参考以下文章