atifaziz / NCrontab

Crontab for .NET
Apache License 2.0
913 stars 139 forks source link

0 0 9 */3 *" ( every 3 month) #135

Closed przemekwa closed 1 month ago

przemekwa commented 2 months ago

I can't generate Occurrences for every 3 months for this cron "0 0 9 /3 " for dates 2020-08-08 - 2021-01-10

Every time I get only 2 results:

09.10.2020 09.01.2021

Where is 09.08.2020 and why is it not:

09.08.2020 09.11.2020 09.01.2020

NCrontab 3.3.1

I have bypass by doing like this: "0 0 9 8,11,1 *"

atifaziz commented 2 months ago

Where is 09.08.2020

By what logic do you expect that?

Every 3rd month is the same as saying Jan,Apr,Jul,Oct. August isn't in that set. Perhaps you're expecting that it's every 3rd month from the starting month?

Note that other cron implementations yield the same months for 0 0 9 */3 *:

image
przemekwa commented 1 month ago

Hello Yes, You are right.

Everything works well.

I didn't understand the difference between every 3 months (3rd) and every 3 months from any month.

Every 3rd month means that the first month will always be January but if I need it every 3 months from a given month I have to give always 4 months like this: 0 0 3 9,12,3,6 *