获取两个日期之间所有日期列表
public static ListgenDateList(Date beginDate,Date endDate){ List dateList = new ArrayList (); Calendar start = Calendar.getInstance(); start.setTime(beginDate); Long startTIme = start.getTimeInMillis(); Calendar end = Calendar.getInstance(); end.setTime(endDate); Long endTime = end.getTimeInMillis(); Long oneDay = 1000 * 60 * 60 * 24l; Long time = startTIme; while (time <= endTime) { dateList.add(new Date(time)); time += oneDay; } return dateList;}
===================================================我不能保证写的每个地方都是对的,但是至少能保证不复制、不黏贴,保证每一句话、每一行代码都经过了认真的推敲、仔细的斟酌。每一篇文章的背后,希望都能看到自己对于技术、对于生活的态度。学习是一种信仰。面对压力,挑灯夜战、不眠不休;面对困难,迎难而上、永不退缩。我是一个纯粹的程序员。===================================================