Skip to content
Quartz100% Client-Side

Cron Expression for First Monday of Month (Quartz)

0 0 12 ? * 2#1At 12:00 PM, on the first Monday of the month

The Quartz cron expression "0 0 12 ? * 2#1" runs a task first monday of month (quartz). Preview the next run times in your timezone, read the plain-English translation, and copy ready-to-paste snippets for crontab, Node.js, GitHub Actions, and AWS EventBridge.

Live playground

  • Sec0
  • Min0
  • Hour12
  • DOM?
  • Month*
  • DOW2#1

At 12:00 PM, on the first Monday of the month

Quartz · evaluated in UTC

24-hour view

Hover a highlighted hour for precise timestamps. Showing the next 50 executions.

Upcoming runs

Timezone

Runs are simulated in the selected IANA timezone. Auto-detected from your browser on first load.

Field breakdown

How each field of 0 0 12 ? * 2#1 is interpreted in the Quartz format.

Field breakdown of 0 0 12 ? * 2#1
FieldValueAllowedStatus
Seconds00-59Valid
Minute00-59Valid
Hour120-23Valid
Day of Month?1-31, L (last day), W (nearest weekday)Valid
Month*1-12 or JAN-DECValid
Day of Week2#11-7 or SUN-SAT (1 = SUN)Valid

Use “0 0 12 ? * 2#1” in real code

Copy-paste configurations for the most common schedulers, converted to each platform’s dialect where needed.

import cron from 'node-cron';

cron.schedule('0 0 12 ? * 2#1', () => {
  console.log('Running task...');
});

Running “0 0 12 ? * 2#1” in production

The # operator: Quartz's nth-weekday grammar

0 0 12 ? * 2#1 fires at 12:00 on the first Monday of every month, and the 2#1 in the day-of-week field is Quartz's ordinal operator: weekday#nth-occurrence. Reading it requires Quartz's numbering, which differs from Unix cron's: Quartz counts 1 = SUN through 7 = SAT, so Monday is 2 (Unix would call it 1), and #1 selects that weekday's first occurrence within the month. The ? occupies day-of-month because exactly one day field must be unconstrained — same rule as EventBridge. Together: 'the Monday (#2's) first appearance (#1) in each month.' The family extends mechanically: 2#2 is the second Monday, 3#2 the second Tuesday (Patch Tuesday in Quartz's native spelling), 6#5 the fifth Friday of months that have one.

The operator's edge case is the fifth occurrence: #1 through #4 exist in every month (even 28-day February contains exactly four of each weekday), but #5 exists only in months long enough to hold a fifth of that weekday — a 5#5 trigger simply does not fire in the other months, silently by design. Schedules relying on #5 need either acceptance of the skip, a fallback #4, or job-side logic. The related modifier L handles the opposite question: 6L is the LAST Friday of the month (last-named-weekday), and 2L the last Monday — between # (nth from start) and L (nth from end), Quartz covers the ordinal weekday calendar that five-field cron cannot approach without guard code.

First-Monday workloads: the maintenance-calendar pattern

The first Monday of the month is operations' favorite recurring appointment, and the schedule's residents show why: monthly maintenance windows placed early in the month (leaving three-plus weeks before the next one for follow-ups), monthly patch and dependency review cycles, access recertifications and compliance checkpoints, billing-cycle opens, and the monthly report generation that lands 'first Monday morning' by policy. Noon rather than midnight because these are supervised activities — a maintenance window people participate in — and 12:00 gives the morning's preparation (staging rehearsal, checklist review) a deadline and the afternoon's execution a start gun.

Porting notes complete the picture: Unix five-field cron has no # and needs the guard pattern (fire weekly on Mondays, 0 12 * * 1, with a day-of-month ≤ 7 check); EventBridge likewise lacks # and falls back to the same guard or a Step Functions calendar; Spring's cron (since 5.3) and the Quarts-compatible dialects accept the # syntax directly; Salesforce's Apex cron supports it with its own numbering — also 1 = SUN — so the same 2#1 semantics port there, and this directory's Salesforce recipes show the spelling. Everywhere the numbering differs from Unix, names-plus-ordinals documentation ('first Monday') beats raw expressions for human review — the expression above is for the scheduler; the words are for the runbook.

Frequently asked questions

What does the cron expression "0 0 12 ? * 2#1" mean?

"0 0 12 ? * 2#1" is a Quartz expression that means: At 12:00 PM, on the first Monday of the month. It contains 6 fields — Seconds (0), Minute (0), Hour (12), Day of Month (?), Month (*), Day of Week (2#1) — and works in any scheduler that accepts the Quartz format.

How does "0 0 12 ? * 2#1" behave in UTC versus local time?

Quartz evaluates the trigger in the timezone configured on the scheduler or on the individual trigger's timeZone property, defaulting to the JVM's default timezone. Spring's @Scheduled uses the server default unless you set the zone attribute per task.

Is "0 0 12 ? * 2#1" valid outside Quartz?

Not directly. Standard Unix cron expects 5 fields without '?', Quartz expects a leading seconds field, AWS EventBridge appends a year and requires '?' in one of the two day fields, and Salesforce System.schedule needs a leading seconds field with 1-based weekdays and an optional trailing year. The conversion snippets below show the equivalent expression for each platform.

Why is first Monday 2#1 and not 1#1 in Quartz?

Quartz numbers day-of-week 1 = SUN through 7 = SAT, so Monday is 2 — and 1#1 would be the first Sunday. The Unix convention (0/7 = SUN, 1 = MON) is inverted, which makes 2#1 the correct spelling for first Monday and the numbering mismatch the standard Quartz porting bug. When in doubt, remember the family: 3#1 first Tuesday, 4#1 first Wednesday, and 1#1 first Sunday — Quartz's 1 is always Sunday.

What happens in months that have no fifth occurrence, like a 5#5 trigger?

Nothing — the trigger simply does not fire that month, silently: #5 exists only in months containing a fifth of that weekday (roughly a third of months for any given weekday). #1 through #4 are safe — even 28-day February holds exactly four of every weekday — so schedules needing guaranteed monthly execution should anchor at #1-#4, or add explicit fallback logic. The same edge applies to L-based constructions only at month lengths' extremes; L itself always resolves to a real date.

About the “0 0 12 ? * 2#1” schedule

0 0 12 ? * 2#1 is the Quartz way to say “At 12:00 PM, on the first Monday of the month”. The simulator above evaluates it entirely in your browser — the timeline, the next-run table, and the timezone switcher all run client-side, so you can paste production schedules without them ever leaving your machine.

Every page in this directory follows the same structure: a plain-English translation, a per-field breakdown, platform-specific snippets, and a timezone-aware simulator. Move between the related intervals below to compare dialects, and validate one final time in the simulator with your own timezone before shipping.

Adjacent intervals and the same schedules expressed for other platforms.