About the Quartz Cron Generator
Quartz Scheduler — and Java frameworks built on similar syntax such as Spring — use a richer cron format with a seconds field, an optional year field and special characters for calendar logic like “last day of the month” or “third Friday”. This generator builds those expressions visually, explains them, and computes the next fire times.
Quartz field reference
| Field | Values | Special characters |
|---|---|---|
| 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 (optional) | empty, 1970–2099 | , - * / |
?— no specific value; required in either day-of-month or day-of-week.L— last:Lin day-of-month = last day;6Lin day-of-week = last Friday.W— nearest weekday:15W= weekday closest to the 15th;LW= last weekday.#— nth weekday:2#1= first Monday of the month.
Features
- Seconds and optional year fields
L,LW,W,#and?support- Visual builder for every field
- Plain-English description
- Next fire times in any time zone
- Validation of the dom/dow
?rule
How to use it
- Start from a preset or type an expression.
- Use the tabs to set seconds, minutes, hours, days, months and year.
- Verify the description and next fire times, then copy the expression into your trigger or
@Scheduledannotation.
Frequently asked questions
Why must one day field be “?”
Quartz does not allow specifying both day-of-month and day-of-week, because the combination is ambiguous. Put ? in the one you don’t use.
Is Spring @Scheduled the same as Quartz?
Very close: Spring uses 6 fields (no year) and supports L, W and # since Spring 5.3, but numbers weekdays 0–7 with Sunday as 0 or 7. Use names like MON-FRI for portability.
How do I fire every 30 seconds?
Use 0/30 * * ? * * — every 30 seconds starting at second 0.