I am getting the number of days until the next "billing cycle" (for example) which starts on the nth
day of the month:
from dateutil.relativedelta import relativedelta
dt = datetime.utcnow() + relativedelta(months=1,day=schedule.cycle_start)
days_till_next_cycle = dt - datetime.utcnow()
Where schedule.cycle_start
is going to be something like 2
for the second day of the month.
This works... But:
How do I find the number of weekdays in that timedelta
.
I took a look at https://pypi.python.org/pypi/BusinessHours/ and could not find any documentation.
I also saw this: Business days in Python which linked me to the link above and rolling my own. It's also been 4 years since that post and I was hoping there might be a simpler way?