?The question mark (?) in Quartz cron
The ? means "no specific value". Quartz and EventBridge make you use it in exactly one of the two day fields, because a schedule cannot demand both a date and a weekday at once.
The rules
- Allowed only in day-of-month and day-of-week.
- Exactly one of the two must be ?.
- The other field holds the real rule, or * if you do not care.
- Spring accepts ? but does not require it.
Examples you can copy
0 0 12 ? * MONAt 12:00 UTC, on Mon. Every Monday at noon: the date is "don't care", the weekday is Monday.
First runs after 1 Jan 2027 (UTC): Mon, 04 Jan 2027, 12:00 · Mon, 11 Jan 2027, 12:00 · Mon, 18 Jan 2027, 12:00
0 0 12 15 * ?At 12:00 UTC, on the 15th of the month. The 15th of every month at noon: the date is set, so the weekday is "don't care".
First runs after 1 Jan 2027 (UTC): Fri, 15 Jan 2027, 12:00 · Mon, 15 Feb 2027, 12:00 · Mon, 15 Mar 2027, 12:00
0 0 12 ? * *At 12:00 UTC. Every day at noon, written with ? in the day-of-month slot.
First runs after 1 Jan 2027 (UTC): Fri, 01 Jan 2027, 12:00 · Sat, 02 Jan 2027, 12:00 · Sun, 03 Jan 2027, 12:00
0 12 ? * MON *At 12:00 UTC, on Mon. The EventBridge form of "every Monday at noon", with the required year field.
First runs after 1 Jan 2027 (UTC): Mon, 04 Jan 2027, 12:00 · Mon, 11 Jan 2027, 12:00 · Mon, 18 Jan 2027, 12:00
Common mistakes
- Writing * in both day fields. Quartz rejects it with "Support for specifying both a day-of-week AND a day-of-month parameter is not implemented".
- Putting ? in the hour or minute field. It is only legal in the two day fields.
Frequently asked questions
Why does Quartz need ?
Unix cron combines the two day fields with OR, which surprises people. Quartz avoids the ambiguity by forcing you to say which one you mean.
Can I use ? in Spring?
Yes, Spring accepts it as the same as *. Spring never requires it.