3

I want to get the difference between two joda dates objects. I know how to calculate the difference between two dates using the below code:

Days.daysBetween(startDate, endDate)

I need to calculate the difference in business days where I want to exclude weekends and holidays. Is there is way for the same?

M.J.
  • 16,266
  • 28
  • 75
  • 97
  • No silver bullet solution for holidays, as they vary by country & industry & business & department. You'll need to find a data feed for your holidays or define your own data. – Basil Bourque Mar 04 '18 at 22:03

1 Answers1

3

Consider these for the number of weekdays

Joda Time: How to get dates of weekdays on some date interval?

Calculate number of weekdays between two dates in Java

As to holidays these are specific to your locale. A Set populated by a config file containing dates should suffice.

Community
  • 1
  • 1
RNJ
  • 15,272
  • 18
  • 86
  • 131