Search code examples
anylogic

How to count number of business days between two dates in AnyLogic?


How we count number of days between two dates excluding holidays in AnyLogic?

I tried the following function but it counts all days including non-business days.

differenceInCalendarUnits()

I appreciate it if someone could help me with that.


Solution

  • Well, this is such a complex task (which holidays, which country, what counts as a holiday? Here in Germany, regions have special days...) that there is no build-in support from AnyLogic nor Java, afaik.

    You need to find a specific Java package that supports this, surely there is something out there.

    Or you define the holidays yourself via a schedule and compute it manually