Quartz cron is similar to Unix cron, but it adds a seconds field, supports an optional year field, and has richer day operators.
| Field | Values | Operators |
|---|---|---|
| Seconds | 0-59 | , - * / |
| Minutes | 0-59 | , - * / |
| Hours | 0-23 | , - * / |
| Day of month | 1-31 | , - * ? / L W |
| Month | 1-12 or JAN-DEC | , - * / |
| Day of week | 1-7 or SUN-SAT | , - * ? / L # |
| Year | 1970-2199 | , - * / |
Quartz expressions have six required fields: seconds, minutes, hours, day of month, month, and day of week. A seventh year field is optional. That means a Unix expression like */5 * * * * is not a valid Quartz expression until a seconds field and day-field behavior are added.
Quartz supports ? for no specific day value, L for last day behavior, W for nearest weekday, and # for the nth weekday of a month. These are useful for schedules like “last weekday of the month” or “third Wednesday of the month.”
| Expression | Meaning |
|---|---|
| 0 */15 * * * ? | Every 15 minutes |
| 0 15 10 * * ? | Every day at 10:15 |
| 0 0 9 ? * MON-FRI | Every weekday at 09:00 |
| 0 0 9 LW * ? | The last weekday of every month at 09:00 |
| 0 0 12 ? * WED | Every Wednesday at noon |