BackendBench
Coffee

Home โ€บ Guides โ€บ W

Cron symbol: W

The W (nearest weekday) character in Quartz cron

A number followed by W means "the weekday nearest to that day of the month". It is how Quartz handles paydays and due dates that fall on weekends.

The rules

Examples you can copy

0 0 9 15W * ?

At 09:00 UTC, on the weekday nearest the 15th of the month. Mid-month payroll on the nearest weekday.

First runs after 1 Jan 2027 (UTC): Fri, 15 Jan 2027, 09:00 ยท Mon, 15 Feb 2027, 09:00 ยท Mon, 15 Mar 2027, 09:00

0 0 9 1W * ?

At 09:00 UTC, on the weekday nearest the 1st of the month. First working day of the month, roughly.

First runs after 1 Jan 2027 (UTC): Fri, 01 Jan 2027, 09:00 ยท Mon, 01 Feb 2027, 09:00 ยท Mon, 01 Mar 2027, 09:00

0 0 9 LW * ?

At 09:00 UTC, on the last weekday of the month. Last working day of the month.

First runs after 1 Jan 2027 (UTC): Fri, 29 Jan 2027, 09:00 ยท Fri, 26 Feb 2027, 09:00 ยท Wed, 31 Mar 2027, 09:00

AWS EventBridgeOpen in tester
0 9 15W * ? *

At 09:00 UTC, on the weekday nearest the 15th of the month. EventBridge supports W as well.

First runs after 1 Jan 2027 (UTC): Fri, 15 Jan 2027, 09:00 ยท Mon, 15 Feb 2027, 09:00 ยท Mon, 15 Mar 2027, 09:00

Common mistakes

Frequently asked questions

Is 1W the same as the first business day?

Mostly. It lands on the first weekday of the month, but ignores holidays.

More cron guides

More tools you might need