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 interprets length 6 cron entries as seconds #122

Closed eswan18 closed 4 years ago

eswan18 commented 5 years ago

Great package! Really handy.

However, I spent a lot of time debugging an issue because I assumed that a length 6 entry ( ) would be interpreted minute-hour-date-month-day-year. Instead, seems to be interpreted as second-minute-hour-date-month-day. The wikipedia entry for cron shows the former, thus my confusion:

image

I think this is a big problem not only because of the confusion it might cause to people googling for the cron spec (like myself), but also because it causes very inconsistent behavior of get_next(). See below.

If you specify a length 5 cron entry, get_next returns datetimes every minute:

image

But if you specify a length 6 cron entry, suddenly it switches to every second.

image

If you want to keep this behavior, it would be great for it to be documented better -- and perhaps for croniter to issue a warning when the user attempts a length 6 entry.

kiorky commented 5 years ago

I also agree, but we support also a bit second repeats, see https://github.com/taichino/croniter/commit/4f1a48483b1a77b3f14b64a91ccb5e879510863a.

We need to handle the ' *'...

I ll see to do that :)

kiorky commented 4 years ago

0.3.32 is out !