[Python] Parse Quartz cron expression with Croniter

Discussão em 'Python' iniciado por Stack, Dezembro 8, 2024.

  1. Stack

    Stack Membro Participativo

    This code:

    starting_point = datetime.datetime.now() - datetime.timedelta(hours=1)
    cron = croniter.croniter('44 5 19 ? * WED,THU,FRI *', starting_point)
    cron.get_next(datetime.datetime)


    Results in:


    croniter.croniter.CroniterBadCronError: Exactly 5 or 6 columns has to be specified for iterator expression.
    ​

    But when using https://www.freeformatter.com/cron-expression-generator-quartz.html, the same expression results in


    At 19:05:44pm, on every Wednesday, Thursday and Friday, every month
    ​

    How to parse this cron expression with croniter?

    Continue reading...

Compartilhe esta Página