Calculate month difference in Joda Time

前端 未结 3 948
野趣味
野趣味 2020-12-11 02:49

At the 4th line of code (ignore whitespace & comments) and beyond I\'m calculating the month difference between 2 dates. This works, but looks a bit hacky. Is there a be

3条回答
  •  孤街浪徒
    2020-12-11 03:47

    Months.monthsBetween(
         start.withDayOfMonth(1),
         end.withDayOfMonth(1)).getMonths()
    

提交回复
热议问题