Quartz Cron

Java's Quartz Scheduler — 6 or 7 fields, seconds resolution, `L`/`W`/`#` tokens, and 1-indexed day-of-week.

Overview

Quartz is the most expressive cron dialect in common use. It adds a seconds field at the start, an optional year field at the end, and the `L`, `W`, `#`, and `?` tokens for advanced date selection.

Quartz is used by Java's Quartz Scheduler, Spring Scheduler (via the same parser), Apache Airflow's `cron_descriptor`, and many enterprise schedulers.

Field Structure

Field Order6 or 7 fields: second minute hour day-of-month month day-of-week [year]
Day-of-Week1=Sunday, 2=Monday, …, 7=Saturday.

Special Characters

TokenMeaning
*Any value.
,List.
-Range.
/Step.
?“No specific value” — required in either DOM or DOW, but not both.
LLast (e.g. `L` = last day of month; `6L` = last Friday of month).
WNearest weekday (`15W` = weekday closest to the 15th).
LWLast weekday of month.
#Nth weekday of month (e.g. `6#3` = third Friday).

Aliases

  • Not supported — no `@hourly` etc.

Comparison vs. Unix Cron

FeatureQuartz CronUnix Cron
Field count6 or 7 (with year)5
Seconds fieldYes (first field)No
Step syntaxYesLimited
Named months/daysYesNo
AliasesNoNo
DOW numbering1=Sun … 7=Sat0=Sun … 6=Sat
DOM vs DOWOne must be `?`OR when both restricted
`L`, `W`, `#`, `LW`YesNo

Examples

0 0 12 * * ?Every day at 12:00:00.Try it →
0 */5 * * * ?Every 5 minutes.Try it →
0 0 0 L * ?Midnight on the last day of every month.Try it →
0 0 0 ? * 6LMidnight on the last Friday of every month.Try it →
0 0 9 ? * 6#39 AM on the third Friday of every month.Try it →
0 0 9 15W * ?9 AM on the weekday nearest the 15th.Try it →
0 0 12 * * ? 2026Daily at noon, but only in 2026 (7-field form).

Gotchas & Pitfalls

  • Day-of-week is 1-indexed with Sun=1 — opposite of Unix cron where Sun=0.
  • Either DOM or DOW must be `?`. `* * * * * *` is invalid in Quartz.
  • The seconds field means a job can fire 60 times per minute — be careful with expensive triggers.
  • `L` in DOW means Saturday (last day of week, value 7), NOT “last day of week of month”. Use `6L` for “last Friday”.

References

Free cron syntax cheat sheet

© 2026 Abel Solutions LLC. All rights reserved. · More from Abel Solutions: RegexPro — test and debug regular expressions