Home โบ Cron errors โบ Quartz
Quartz runs a day early: weekday numbers start at Sunday = 1
Why this happens
In Quartz, 1 is Sunday, so 1-5 means Sunday to Thursday. Unix cron numbers Monday as 1, which is why copied expressions end up one day early.
Wrong and right
0 0 9 ? * 1-5Runs on: Sun 03 Jan, 09:00, Mon 04 Jan, 09:00, Tue 05 Jan, 09:00, Wed 06 Jan, 09:00, Thu 07 Jan, 09:00, Sun 10 Jan, 09:00, Mon 11 Jan, 09:00
0 0 9 ? * 2-6At 09:00 UTC, on Mon, Tue, Wed, Thu and Fri. First runs after 1 Jan 2027 (UTC): Fri 01 Jan, 09:00, Mon 04 Jan, 09:00, Tue 05 Jan, 09:00, Wed 06 Jan, 09:00, Thu 07 Jan, 09:00
How to fix it
- Add one to every Unix weekday number, or
- write MON-FRI, which works in every dialect and cannot be misread.
- Run the expression through a next-run preview to confirm the days.
The Quartz format at a glance
Fields in order: second (0-59), minute (0-59), hour (0-23), day-of-month (1-31), month (1-12), day-of-week (1-7, 1 = Sunday), year (1970-2199, optional).
Quartz uses the JVM default time zone unless you set one: CronScheduleBuilder.cronSchedule(expr).inTimeZone(TimeZone.getTimeZone("UTC")).
The fixed schedule in other systems
If you are moving this schedule to another scheduler, these are the equivalents of 0 0 9 ? * 2-6:
| System | Expression |
|---|---|
| Spring | 0 0 9 * * 1-5 |
| Crontab | 0 9 * * 1-5 |
| Kubernetes | 0 9 * * 1-5 |
| AWS EventBridge | 0 9 ? * 2-6 * |
| Jenkins | 0 9 * * 1-5 |
| GitHub Actions | 0 9 * * 1-5 |
| node-cron | 0 9 * * 1-5 |
| Apache Airflow | 0 9 * * 1-5 |
| Azure Functions | 0 0 9 * * 1-5 |
| Google Cloud Scheduler | 0 9 * * 1-5 |
Try it yourself
The tester below starts with the fixed expression. Change it and watch the schedule update.
Your week at a glance
Upcoming runs
| # | Local | UTC | From now |
|---|
Copy-ready code
Frequently asked questions
Why does my job not run on Fridays?
If you wrote 1-5 thinking Monday to Friday, Quartz runs it Sunday to Thursday, so Friday is missed.
More Quartz fixes
See the full Quartz cron builder or convert between formats.