Search code examples
javacronquartz-schedulercronexpression

quartz scheduler: run on last day of the month and few other days


I want to run a job on the 3rd and last day of a month.

Is the following cron expression correct ?

"0 0 3 3,L * * ?"

When I try it in www.cronmaker.com it says it's an invalid expression.

The main point of this question is if I can use "L" (representing the last day of month with other days)

If not, how can I express it using Cron ?


Solution

  • The correct format should be

    0 0 0 3,L * ? *
    

    but as you correctly state cromaker.com does not seem to be it.

    If you used two crons

    0 0 0 3 * ? * 0 0 0 L * ? *

    it would work