Skip to content

Lib does not allow for cron expression with Year as specified in Quartz #6

Closed

Description

the following expressions "00 00 09 12 03 2019" or "00 00 09 12 03 ? 2019" are valid cron expression as specified in the Quartz cron tutorial : http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html

However they are not handled by the library as it is said in the README file.

Activity

  1. mariusbancila commented on Aug 12, 2026

    @mariusbancila
    Owner

    Fixed in #49. make_cron now accepts the optional seventh field:

    "00 00 09 12 03 ? 2019"  ->  2019-03-12 09:00:00
    

    under all three traits (with month 02 for oracle, which numbers months from zero). Asked from a date after that day it correctly reports no next occurrence, since the year has gone by.

    Your first expression, 00 00 09 12 03 2019, stays rejected — that's six fields, which puts 2019 in the day-of-week position. Quartz doesn't accept it either; the tutorial you linked specifies [Year] as an optional seventh field, after day-of-week. The error message now says the value is out of range rather than complaining about the field count.

    Both cases are covered by tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions