Skip to content
SpringCronTools

guide

Spring Cron vs Quartz Cron

Spring deliberately copied Quartz syntax for L, W and #, but it did not copy Quartz numbering. Mixing the two is the usual reason a converted expression fires on the wrong day.

Day-of-week numbering

Quartz numbers days 1-7 with SUN = 1 and SAT = 7. Spring follows classic cron and numbers 0-6 with SUN = 0, additionally accepting 7 as Sunday.

A Quartz "6L" (last Friday) is "5L" in Spring. A Quartz "2-6" (Monday to Friday) is "1-5" in Spring.

Last Friday of the month:
  Quartz: 0 0 0 ? * 6L
  Spring: 0 0 0 * * 5L

Names avoid the problem

Both dialects accept MON, TUE, … SUN, and those names mean the same weekday in both. If a schedule uses names, converting only requires renumbering days that were written as digits.

0 0 9 ? * MON-FRI   // identical in Quartz and Spring

The year field

Quartz accepts a seventh year field ("0 0 12 ? * MON-FRI 2025"). Spring has no year field at all, so a year-pinned Quartz schedule cannot be converted without changing behaviour: the Spring version repeats every year.

Everything else matches

Apart from the weekday numbering, the syntax is the same. Spring copied Quartz on purpose.

Everything else matches: Quartz compared with Spring
ConstructQuartzSpring
Field count6, seconds first6, seconds first
L, LW, <n>Wyesyes
<dow>L, <dow>#<n>yesyes
? in a day field"no specific value""no specific value"
Both day fields restrictedboth must matchboth must match
Weekday numbers1-7, SUN = 10-7, 0 = Sunday
Year field7th fieldnot supported

nextRelated guides

nextRelated tools

Questions

Is Spring cron identical to Quartz cron?

Almost. The syntax is the same, but day-of-week numbers differ: Spring 0-7 with 0 = Sunday, Quartz 1-7 with SUN = 1.

Can a Quartz expression with a year field be converted?

Only by dropping the year, which makes the schedule run every year instead of once. The converter warns about this.

referencesSources

A Spring cron expression is six space-separated fields — second, minute, hour, day-of-month, month, day-of-week — read left to right.
Field order per the CronExpression reference; the wording here is this site's, not a quotation from it.

Found a rule this site gets wrong? The parser is one file: the six-field reference lists every construct it accepts.