java 获取两个日期之间的所有天数

 Calendar start = Calendar.getInstance();
start.set(2017, 2, 20);
Long startTIme = start.getTimeInMillis(); Calendar end = Calendar.getInstance();
end.set(2017, 2, 23);
Long endTime = end.getTimeInMillis(); Long oneDay = 1000 * 60 * 60 * 24l; Long time = startTIme;
while (time <= endTime) {
Date d = new Date(time);
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
System.out.println(df.format(d));
time += oneDay;
}
上一篇:ABP入门教程0 - 目录


下一篇:(转)VS2010-MFC编程入门教程之目录和总结