java 计算两个日期间的所有日期

public static void main(String[] args) {

Calendar start = Calendar.getInstance();
start.set(2014, 6, 11);
Long startTIme = start.getTimeInMillis();

Calendar end = Calendar.getInstance();
end.setTime(new Date());
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;

}

}

上一篇:GIT(6)----fork和clone的区别,fetch与pull的区别


下一篇:JSON.parse()和JSON.stringify() 的用法区别