Quartz uses 6 or 7 fields (year is optional) and supports unique special characters: L for last, W for weekday, # for nth-of-month, and ? for "no value".
| Expression | What it means | Typical use |
|---|---|---|
0 0/15 * * * ? |
Every 15 minutes | Frequent polling, batch processing. |
0 0 12 * * ? |
Every day at 12 PM | Lunch-hour notifications. |
0 0 9 ? * MON-FRI |
Weekdays at 9 AM | Business batch jobs. |
0 0 0 L * ? |
Last day of every month at midnight | Month-end accounting. |
0 0 0 ? * 2#1 |
First Monday of each month | Monthly board meetings. |
0 0 0 ? * 6L |
Last Friday of every month | Quarterly archive tasks. |
Click any expression to load it into the tool above.
Beyond standard cron, Quartz adds: L (last day-of-month or last weekday), W (nearest weekday), # (nth-of-month, like 2#1 = first Monday), and ? (no specific value, required when one day field is set).
In day-of-month and day-of-week fields, one of them MUST be ? if the other is set. So 0 0 9 ? * MON-FRI not 0 0 9 * * MON-FRI. Outside of day fields, use * normally.
L in the day-of-month field: 0 0 0 L * ? runs at midnight on the 28th/29th/30th/31st depending on the month.
W is the "nearest weekday". 15W in day-of-month means "the weekday closest to the 15th" — if the 15th is a Saturday, it fires on Friday the 14th. If Sunday, it fires on Monday the 16th.
Use #: 0 0 0 ? * 2#1. The format is day-of-week#nth-of-month. Days: 1=Sunday, 2=Monday … 7=Saturday.