取得指定日期区间内的日期,包括两端日期
public List<String> getDateList(String start, String end) throws ParseException{List<String> rlist = new ArrayList<String>();Date date = null;Calendar cal = Calendar.getInstance();date = new SimpleDateFormat("yy-MM-dd").parse(start); rlist.add(new SimpleDateFormat("yyyy-MM-dd").format(date));cal.setTime(date);while(true){cal.add(Calendar.DAY_OF_MONTH, 1);SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");System.out.println(sdf.format(cal.getTime()));rlist.add(sdf.format(cal.getTime()));if(sdf.format(cal.getTime()).equals(end)){break;}}return rlist;}?