0

How would I go about scheduling a job in Python APScheduler for the last business day of the month, at 5:30pm?

For example:

  1. If the last day of the month falls on a Sunday, I would like the job to execute on Friday at 5:30pm.
  2. If the last day of the month falls on a Wednesday, I would like the job to execute that Wednesday at 5:30pm.

Thank you!

albz
  • 53
  • 5
  • 1
    There is no way of APScheduler knowing what a 'business day' or 'business month' is for your specific business. You will have to work out the next x month end dates and schedule tasks on each individual date. – JeffUK Dec 15 '20 at 00:27
  • First look at how you can detect and deal with business days, e.g. in [this topic](https://stackoverflow.com/questions/2224742/most-recent-previous-business-day-in-python). Scheduling the rest is trivial. – s0mbre Dec 15 '20 at 00:40

0 Answers0