How can I get the number of business days between two java.util.Date, i.e. excluding weekends and holidays? By holidays, I mean legally recognized holidays. It must be depending on the country, because of the holidays that are different from a country to another.
For example, 2012-08-27 - 2012-08-24 should return 1 instead of 3, because of the weekend inbetween.
I already had a look on Jollyday and ObjectLab-Kit, but I can’t make them meet my need. I mean, both of them have a lot of interesting methods, but can’t find something like getBusinessDaysCount(Date d1, Date d2)…
Here is finally a solution based on the
CalendarAPI:Calling with: