Search code examples
pythoncronschedulerapscheduler

Apscheduler run job every weekday on specific time range


I have a current apscheduler that runs the job mon-fri and an interval of ~4 mins all day long. Is it possible to run the job for a specific time range? Lets say from 9:00 am to 5:00 pm in this case?

My expression looks like this:

scheduler.add_job(feed_data, 'cron', day_of_week='mon-fri', minute='*/3', jitter=30)

Is it possible to add start/end datetime to this expression?


Solution

  • You can just add hour='9-17' to accomplish that.