Home โบ Cron errors โบ Quartz
Quartz error: unexpected end of expression
java.text.ParseException: Unexpected end of expression.Why this happens
The expression has too few fields. Quartz needs six (or seven with year), but this is a five-field Unix expression.
Wrong and right
0 0 12 * *Our parser says: Quartz (6-7 field) needs 6 or 7 fields, but you gave 5
0 0 12 * * ?At 12:00 UTC. First runs after 1 Jan 2027 (UTC): Fri 01 Jan, 12:00, Sat 02 Jan, 12:00, Sun 03 Jan, 12:00, Mon 04 Jan, 12:00, Tue 05 Jan, 12:00
How to fix it
- Add a seconds field at the start.
- Put ? in one of the two day fields.
- Count the fields: seconds, minutes, hours, day-of-month, month, day-of-week.
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 12 * * ?:
| System | Expression |
|---|---|
| Spring | 0 0 12 * * * |
| Crontab | 0 12 * * * |
| Kubernetes | 0 12 * * * |
| AWS EventBridge | 0 12 * * ? * |
| Jenkins | 0 12 * * * |
| GitHub Actions | 0 12 * * * |
| node-cron | 0 12 * * * |
| Apache Airflow | 0 12 * * * |
| Azure Functions | 0 0 12 * * * |
| Google Cloud Scheduler | 0 12 * * * |
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
Does Quartz accept five fields?
No. Six are required; the seventh (year) is optional.
More Quartz fixes
See the full Quartz cron builder or convert between formats.