> Markdown version of https://opspane.dev/cron/quartz/ for AI agents and readers: the same text, without navigation or the interactive tool.
>
> The tool computes its result with JavaScript in the browser, so this file holds the reference text, worked examples and FAQ. Open the page to run it on your own input.
>
> Answer endpoint for agents: the same URL parameters on https://opspane.dev/cron/quartz/answer.md return the computed result as Markdown, without JavaScript, e.g. https://opspane.dev/cron/quartz/answer.md?expr=0%200%2012%20*%20*%20%3F&tz=Europe%2FBerlin

# Quartz Cron Expression

Explain and build Quartz and Spring @Scheduled cron expressions — 6 or 7 fields, L, W, # and ? — with next run preview.

## Quick answer

- Six or seven fields: seconds, minutes, hours, day of month, month, day of week and an optional year.
- Exactly one of day-of-month and day-of-week must be `?`: `0 0 12 * * ?` runs every day at noon, `0 0 12 * * *` is rejected.
- Day of week runs from 1 (Sunday) to 7 (Saturday); 0 is invalid.
- `L` is the last day of the month, `15W` the weekday nearest the 15th, `6L` the last Friday and `6#3` the third Friday.

## How to use

1. Paste a Quartz cron expression: six fields starting with seconds, plus an optional year.
2. Pick the time zone the trigger runs in. The preview lists the next 10 fire times in that zone and in UTC.
3. Copy the ready-made Quartz `CronScheduleBuilder` or Spring `@Scheduled` snippet below the tool.

## Quartz cron expression format

| # | Field | Allowed values | Special characters |
| --- | --- | --- | --- |
| 1 | Seconds | `0–59` | `, - * /` |
| 2 | Minutes | `0–59` | `, - * /` |
| 3 | Hours | `0–23` | `, - * /` |
| 4 | Day of month | `1–31` | `, - * ? / L W` |
| 5 | Month | `1–12` or `JAN–DEC` | `, - * /` |
| 6 | Day of week | `1–7` (1 = Sunday) or `SUN–SAT` | `, - * ? / L #` |
| 7 | Year (optional) | `1970–2199` | `, - * /` |

A step such as `0/15` starts at 0 and repeats every 15; `5/15` starts at 5. A range whose start is after its end wraps around, so `FRI-MON` means Friday, Saturday, Sunday and Monday.

`0 0 12 ? * FRI-MON` Quartz · July 2026

A range whose start is after its end wraps the week: `FRI-MON` means Friday through Monday, so each block of four days fires together — **17 of July's 31 days** are runs.

## Special characters: ? L W #

### Exactly one day field is `?`

`?` means “no specific value”. Exactly one of day-of-month and day-of-week must be `?` — Quartz rejects an expression that sets both.

### `L`, `W` and `#`

`L` in day-of-month is the last day of the month — `L-3` is three days before it — and `LW` is the last weekday of the month. `15W` is the weekday nearest the 15th, never crossing into another month. In day-of-week, `6L` is the last Friday of the month (`L` alone means Saturday), and `6#3` or `FRI#3` is the third Friday of the month.

`0 0 23 L * ?` 23:00 on the last day · Feb–Apr 2026

`L` follows the month: 28 February, 31 March, 30 April 2026 — never a fixed 30 or 31.

The field map above draws these rules as hatched cells: the exact day depends on the month, so the run preview is the authority.

## Quartz vs Spring @Scheduled vs Unix cron

|  | Quartz | Spring @Scheduled | Unix crontab |
| --- | --- | --- | --- |
| Fields | 6 or 7 (seconds first, optional year) | 6 (seconds first) | 5 (minute first) |
| Sunday | `1` or `SUN` | `0`, `7` or `SUN` | `0`, `7` or `sun` |
| `?` required | Yes, in one day field | No | Not supported |
| `L W #` | Yes | Yes | No |
| Both day fields set | Rejected | Allowed | Either may match |

## Daylight saving time

Quartz evaluates the expression in the trigger's time zone. A fire time inside the hour skipped in spring never happens that day. A fire time inside the hour repeated in autumn fires once, at the second occurrence (standard time) — unlike Linux cron, which runs it twice. Set a time zone above and the warnings list the affected dates.

## How the results are verified

The preview is checked against `org.quartz.CronExpression` from Quartz 2.3.2 on 61 expressions and 176 start-time and time-zone combinations, including the 2026 daylight-saving changes in New York, Berlin and Lord Howe Island and quirks such as `31W` in a 30-day month. Found a mismatch? [Tell us](https://opspane.dev/contact/) and it becomes a test case.

## FAQ

### What does ? mean in a Quartz cron expression?

? means “no specific value” and is only allowed in the day-of-month and day-of-week fields. Quartz needs exactly one of those two fields to be ?, so 0 0 12 * * ? (every day) is valid while 0 0 12 * * * is rejected.

### Why does Quartz reject 0 0 12 1 * MON?

Quartz cannot combine a day of month with a day of week in one expression. Put ? in one of them, or create two triggers: one with 0 0 12 1 * ? and one with 0 0 12 ? * MON. The Cron Expression Converter on this site splits such schedules for you.

### How do I run a Quartz job on the last day of the month?

Use L in the day-of-month field: 0 0 23 L * ? runs at 23:00 on the last day of every month. L-2 is two days before the last day, and LW is the last weekday (Monday to Friday) of the month.

### Is Sunday 0 or 1 in Quartz?

In Quartz, day-of-week runs from 1 (Sunday) to 7 (Saturday); 0 is invalid. Spring's @Scheduled uses 0 or 7 for Sunday and 1 for Monday, so prefer names such as MON-FRI when the expression may run in both.

### Can I use a Quartz expression in Spring @Scheduled?

Mostly. Spring's @Scheduled also takes six fields starting with seconds and supports ?, L, W and #, but it has no year field and numbers the days of the week differently. Drop the year and use day names, and the same expression works in both.

### What happens to Quartz triggers when clocks change for daylight saving?

A time that does not exist (the hour skipped in spring) never fires. A time that happens twice (the hour repeated in autumn) fires once, at its second occurrence. Pick your time zone above and the warnings name the dates.

## Related tools

- [AWS EventBridge Cron](https://opspane.dev/cron/aws-eventbridge/): Validate AWS EventBridge cron and rate expressions, see next run times in UTC and generate Terraform, CloudFormation or AWS CLI snippets.
- [Cron Expression Converter](https://opspane.dev/cron/translate/): Convert one schedule to crontab, Quartz, AWS EventBridge, GitHub Actions, Kubernetes and systemd — with next run times for each.
- [Cron Expression Explainer](https://opspane.dev/cron/explainer/): Understand any cron expression in plain English, with timezone-aware next run times and warnings for schedules that never fire.
