taichino / croniter

croniter is a python module to provide iteration for datetime object.
http://github.com/taichino/croniter
387 stars 105 forks source link

Croniter skips 2021-03-01 for "0 0 */10 * *" #178

Closed cuu508 closed 2 years ago

cuu508 commented 3 years ago

Test snippet:

from datetime import datetime
from croniter import croniter

it = croniter("0 0 */10 * *", datetime(2021, 1, 1))

for i in range(0, 15):
    print(it.get_next(datetime).isoformat())

Result:

2021-01-11T00:00:00
2021-01-21T00:00:00
2021-01-31T00:00:00
2021-02-01T00:00:00
2021-02-11T00:00:00
2021-02-21T00:00:00
2021-03-11T00:00:00
2021-03-21T00:00:00
2021-03-31T00:00:00
2021-04-01T00:00:00
2021-04-11T00:00:00
2021-04-21T00:00:00
2021-05-01T00:00:00
2021-05-11T00:00:00
2021-05-21T00:00:00

In the above output, 2021-03-01T00:00:00 is missing.

kiorky commented 2 years ago

Seems it's a DST drift, we never found proper implementations and i dont have anymore time to make such invasive mr as in https://github.com/kiorky/croniter-fork/pull/34

cuu508 commented 2 years ago

In the sample I was using naive datetimes, so not sure it could be DST-related. Maybe it has something to do with February 28-29 being "special".

kiorky commented 2 years ago

@cuu508 please continue discussion by switching on https://github.com/kiorky/croniter fork (reopen bugs would be welcome).

Idea is that @taichino seems not longer available (YEARS) and with successives github versions, im losing more and more control on that repo.