Five-field Unix cron versus six-field Quartz and EventBridge
One-line answer: Seconds, weekday numbers, the ? rule and the year field: what changes when you move a schedule between cron dialects.
“Cron” is not one format. Linux crontab uses five fields, Quartz and Spring use six with seconds, and AWS EventBridge uses six with a year. The same string pasted into a different product can run at a completely different time.
| Format | Field order | Weekday numbers | Distinctive rule |
|---|---|---|---|
| Unix/Vixie | min hour day month weekday | 0 = Sunday | day and weekday combine with OR |
| Quartz/Spring | sec min hour day month weekday | 1 = Sunday | one of day/weekday must be ?; L, W, # |
| AWS EventBridge | min hour day month weekday year | 1 = Sunday | year field required, no seconds |
What the seconds field changes
Quartz's 0 0 9 * * ? is 09:00:00 every day. Pasted into five-field Unix cron it has one field too many and fails. The reverse is just as bad: Unix's 0 9 * * * in Quartz is read as second 0, minute 9, hour … and shifts every value. When converting, count the fields first.
The year field
AWS EventBridge cron ends with a year, as in 0 9 * * ? 2026, meaning 09:00 every day in 2026 only. Quartz can also add a year as a seventh field. CronPulse treats a six-field expression whose last token contains a four-digit year as EventBridge, and otherwise as Quartz.
AND versus OR for day and weekday
Unix treats day-of-month and day-of-week as OR when both are restricted. Quartz expects one of them to be ?, so only the other applies. 0 0 12 ? * MON-FRI is noon on weekdays; 0 0 12 15 * ? is noon on the 15th. Neither expresses “the 15th if it is a weekday” without extra logic.
Converting the same job
Unix 0 9 * * 1-5 weekdays 09:00
Quartz 0 0 9 ? * MON-FRI weekdays 09:00
EventBridge 0 9 ? * MON-FRI * weekdays 09:00
All three describe one job, yet all three strings differ. Whenever a schedule is written down, record the dialect next to it; that one habit prevents most migration incidents.
Paste an expression and see its next run times right away.
Open CronPulseFrequently asked questions
What does Spring's `@Scheduled(cron = "0 0 9 * * ?")` mean?
Seconds, minutes, hours, day, month, weekday: 09:00:00 every day. Spring uses the server's local time zone unless the zone attribute names an IANA zone.
Can EventBridge run a job every few seconds?
No. EventBridge schedules are minute-granular. For sub-minute precision you need Step Functions, an application timer, or another scheduler alongside it.
Sources
Related reading
- Cron in five fields: minute, hour, day, month, weekdayWhat each of the five Unix cron fields means, which values are allowed, and how to read an expression without guessing.
- Cron special characters: *, /, -, commas, ?, L, W and #The eight symbols that make cron expressive, what each one means, and where implementations disagree.
- Daylight saving and cron: the day 02:30 disappearsHow clock changes affect cron runs, and how to move jobs out of the 2–3 AM danger window.
- Idempotency: stopping the autumn duplicate runKey design, locking and notification patterns that keep a job safe when the same wall clock appears twice.