Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not limit the Day-Of-The-Month #140

Open
Vishal-Shunyeka opened this issue Nov 29, 2024 · 0 comments
Open

Does not limit the Day-Of-The-Month #140

Vishal-Shunyeka opened this issue Nov 29, 2024 · 0 comments

Comments

@Vishal-Shunyeka
Copy link

Vishal-Shunyeka commented Nov 29, 2024

While using this snippet, it fails to limit the next dates to be between 4 and 28

from datetime import datetime
from croniter import croniter
from pytz import timezone

def run_at(expression):
    base = datetime(2024, 11, 29, 0, 0, 0, 0, tzinfo=timezone("UTC"))
    iterator = croniter(expression, base)
    return iterator.get_next(datetime)

expression = "*/25 */10 4-28 * */3"
print(run_at(expression))

Current Outupt:

2024-11-30 00:00:00+00:00

Expected Output:

2024-12-04 00:00:00+00:00

for example: crontab.guru output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant