if(request.getParameter("PeriodType")==""){
if(request.getParameter("startdate")!=null)
StartDate = request.getParameter("startdate");
if(request.getParameter("endDate")!=null)
EndDate = request.getParameter("endDate");
答案 0 :(得分:2)
如果您不想使用外部库,可以使用GregorianCalendar
:
int i = 5;
Date date = new Date();
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(date);
gc.add(GregorianCalendar.MONTH, -i);
Date dateBefore = gc.getTime();
System.out.println(date);
System.out.println(dateBefore);
答案 1 :(得分:0)