Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quartz cron expression - last thursday of every month

I am using Quartz Scheduling and Spring Batch and I need to run a particular job on the last Thursday of every month.

Is it possible to create such a Quartz cron expression?

Thanks,

like image 721
Joel Avatar asked Aug 14 '12 11:08

Joel


1 Answers

Yes, Quartz has a special character -- L ("last") --, which allows you to define expressions such as the last friday of the month.

To fire a job at, say, 10am, on the last Thursday (5L) of every month, you can use the following cron expression:

0 0 10 ? * 5L
like image 92
João Silva Avatar answered Oct 12 '22 23:10

João Silva