BackendBench
Coffee

Home โ€บ Cron errors โ€บ Quartz

Quartz ยท error

Quartz error: day-of-week AND day-of-month not implemented

java.text.ParseException: Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.

Why this happens

Quartz cannot express "the 15th AND a Monday" or "the 15th OR a Monday", so it refuses any expression that restricts both day fields.

Wrong and right

wrong
0 0 12 15 * MON

Our parser says: Use ? in exactly one of day-of-month and day-of-week

fixed
0 0 12 15 * ?

At 12:00 UTC, on the 15th of the month. First runs after 1 Jan 2027 (UTC): Fri 15 Jan, 12:00, Mon 15 Feb, 12:00, Mon 15 Mar, 12:00, Thu 15 Apr, 12:00, Sat 15 May, 12:00

How to fix it

  1. Decide which rule you actually want: a date or a weekday.
  2. Put ? in the day field you are not using.
  3. For "the first Monday", use the # form: 0 0 12 ? * 2#1.

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 15 * ?:

SystemExpression
Spring0 0 12 15 * *
Crontab0 12 15 * *
Kubernetes0 12 15 * *
AWS EventBridge0 12 15 * ? *
Jenkins0 12 15 * *
GitHub Actions0 12 15 * *
node-cron0 12 15 * *
Apache Airflow0 12 15 * *
Azure Functions0 0 12 15 * *
Google Cloud Scheduler0 12 15 * *

Try it yourself

The tester below starts with the fixed expression. Change it and watch the schedule update.

Your week at a glance
fewer more runs

Upcoming runs

#LocalUTCFrom now

Copy-ready code

Frequently asked questions

Can I run on the 15th only if it is a Monday?

Not in the expression. Schedule the 15th and check the weekday inside the job.

More Quartz fixes

See the full Quartz cron builder or convert between formats.

More tools you might need