java日期操作(获取今天日期,并减去12天)

        Date today = new Date();
	Calendar cal=new GregorianCalendar();
	cal.setTime(new Date());
	cal.add(Calendar.DATE, -12);
	String beginTime=DateUtil.dateToStr(cal.getTime());
	String endTime = DateUtils.formatDate(today);	
       


你可能感兴趣的:(java日期操作(获取今天日期,并减去12天))