/**
* 获取两个日期间隔的所有日期
* @param start 格式必须为'2018-01-25'
* @param end 格式必须为'2018-01-25'
* @return
*/
public static List<String> getBetweenDate(String start, String end){
List<String> list = new ArrayList<>();
LocalDate startDate = LocalDate.parse(start);
LocalDate endDate = LocalDate.parse(end);
long distance = ChronoUnit.DAYS.between(startDate, endDate);
if (distance < 1) {
return list;
}
Stream.iterate(startDate, d -> {
return d.plusDays(1);
}).limit(distance + 1).forEach(f -> {
list.add(f.toString());
});
return list;
}