I have three lists that define when a task should be executed:
- minute: A list of integers from 0-59 that represent the minutes of an hour of when execution should occur;
- hour: A list of integers from 0-23 that represent the hours of a day of when execution should occur
- day_of_week: A list of integers from 0-6, where Sunday = 0 and Saturday = 6, that represent the days of a week that execution should occur.
Is there a easy way to calculate what's the timedelta until the next execution in Python?
Thanks!
EDIT: For example, if we have the following lists:
day_of_week = [0]
hour = [1]
minute = [0, 30]
The task should run twice a week at 1:00 and 1:30 every Sunday. I'd like to calculate the timedelta until the next occurance based on current time.