javacronquartz-schedulercrontrigger

Cron expression for the second to last day of week of the month


I want to trigger the second to last day of week of the month.

Typically, here is the last friday of the month (ex : 30/06/2017)

0 0 0 ? * FRIL 

And I want the second to last (ex : 23/06/2017)

0 0 0 ? * FRIL-1 

But this syntax return the same result as before (with the Quartz scheduler and with cronmaker)

The second to last day of week of the month can appear either the 3rd or the 4th week of the month. So it's :

either : 0 0 0 ? * FRI#3 
or     : 0 0 0 ? * FRI#4 

Do you have any advice ?


Solution

  • I don't think you can express that using cron syntax.
    I can think of some work-arounds, though: