Why LocalDate.plusDays not working here?

后端 未结 2 1775
栀梦
栀梦 2020-12-21 17:38

I\'m trying to split a date range into individual dates in the following way:

private static void splitDates(LocalDate dateFrom, LocalDate dateTo) {
    whil         


        
2条回答
  •  Happy的楠姐
    2020-12-21 17:45

    plusDays doesn't alter the original LocalDate, you have to assign the result :

    dateFrom = dateFrom.plusDays(1L);
    

提交回复
热议问题