Closed prha closed 1 year ago
It's not a bug, but what was intended:
for your use case, this can be a solution:
>>> base = datetime(2010, 8, 24, 23, 59)
>>> it1 = croniter('0 */3 * * *', base)
>>> it2 = croniter('30 1-23/3 * * *', base)
>>> times = [it1.get_next(datetime) for i in range(8)]
>>> times += [it2.get_next(datetime) for i in range(8)]
>>> times.sort()
>>> pprint(times)
[datetime.datetime(2010, 8, 25, 0, 0),
datetime.datetime(2010, 8, 25, 1, 30),
datetime.datetime(2010, 8, 25, 3, 0),
datetime.datetime(2010, 8, 25, 4, 30),
datetime.datetime(2010, 8, 25, 6, 0),
datetime.datetime(2010, 8, 25, 7, 30),
datetime.datetime(2010, 8, 25, 9, 0),
datetime.datetime(2010, 8, 25, 10, 30),
datetime.datetime(2010, 8, 25, 12, 0),
datetime.datetime(2010, 8, 25, 13, 30),
datetime.datetime(2010, 8, 25, 15, 0),
datetime.datetime(2010, 8, 25, 16, 30),
datetime.datetime(2010, 8, 25, 18, 0),
datetime.datetime(2010, 8, 25, 19, 30),
datetime.datetime(2010, 8, 25, 21, 0),
datetime.datetime(2010, 8, 25, 22, 30)]