获得这两个时间的所有天数及其周几

List<DateUtil> dateList = new ArrayList<>();

long distance = ChronoUnit.DAYS.between(todayLocal, plusXDayLocal);

Stream.iterate(todayLocal, d -> d.plusDays(1)).limit(distance + 1).forEach(f -> {
    DateUtil d = new DateUtil();
    d.setDate(f.toString());
    d.setWeekly(EnumUtil.WEEKLY.getValueByCode(f.getDayOfWeek().toString()));
    dateList.add(d);
});
原文地址:https://www.cnblogs.com/baobeiqi-e/p/9884722.html