atifaziz / NCrontab

Crontab for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wrong occurance result

serkanp opened this issue · comments

please check this cron string
45 */1 */16,17,18 2,3 *
it must be between 16,17,18. days but occurance result gives 1 , 17 ,18. days..

If you want days 16-18 then you want the following expression:

45 */1 16-18 2,3 *

The expression 45 */1 */16,17,18 2,3 * gives 1st of the month because */16 gives you every 16th day of the month starting from the 1st. So you get day 1 then 1 + 16 (= 17). On top of that, 17,18 give you day 17th and 18th but 17th here is redundant with */16 so you get 1, 17 and 18 in the end.

You can also check the same interpretation on crontab.guru for 45 */1 */16,17,18 2,3 *.

I am closing this as by-design product of how the cron expression works.