Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk2 min

What Do ?, L, W, and # Mean in Quartz Cron Expressions?

Quartz uses ?, L, W and # in its day fields to express no specific day, last-day rules, nearest weekdays and nth weekday occurrences.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In Quartz cron expressions, ? means “no specific value” in the day-of-month or day-of-week field; L means a last calendar day or weekday, depending on its position; W selects the weekday nearest a day of the month; and # selects the nth occurrence of a weekday in a month. These symbols have Quartz-specific meanings, so check your scheduler’s documentation before applying them elsewhere.

Where these symbols appear in a Quartz expression

Quartz expressions have separate day-of-month and day-of-week fields. The special symbols discussed here act in those fields, and their meaning depends on which field contains them. The official Quartz 2.5.1 CronExpression API documents the parser’s syntax; the Quartz 2.3.0 CronTrigger tutorial gives additional examples.

As an Amazon Associate I earn from qualifying purchases.

What does ? mean?

? means “no specific value.” Quartz allows it in either the day-of-month or day-of-week field. It is typically used in the field that you are not using to choose a day. Quartz documentation says support for specifying both a day-of-month and a day-of-week value is incomplete, so ordinarily put the specific day selection in one field and ? in the other.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For example, 0 15 10 10 * ? means 10:15:00 on the tenth day of each month, without a specific day-of-week selection.

What does L mean?

L means a “last” value, but the result depends on the day field and its position.

  • Day-of-month: L means the last calendar day of the month.
  • Day-of-week by itself: L means 7, or Saturday.
  • Day-of-week after a weekday value: A value followed by L means that weekday’s last occurrence in the month. For example, 6L or FRIL means the last Friday, using Quartz’s example numbering.
  • LW in day-of-month: This means the last weekday of the month.

Avoid combining L with lists or ranges: Quartz warns that these combinations can produce confusing or unexpected results.

What does W mean?

W selects the weekday (Monday through Friday) nearest a specified day-of-month number. For example, 15W selects the 15th if it is a weekday, the 14th if the 15th is a Saturday, or the 16th if the 15th is a Sunday. It will not move into a different month: if the first is a Saturday, 1W resolves to Monday the 3rd.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

W is for a single day-of-month value, not a range or list. For instance, 0 0 9 15W * ? means 09:00 on the weekday nearest the 15th, staying within that month.

What does # mean?

# selects the nth occurrence of a weekday in the month, in the day-of-week field. In Quartz’s numbering examples, 6#3 is the third Friday, 2#1 is the first Monday, and 4#5 is the fifth Wednesday. If the requested occurrence does not exist in a particular month, the trigger does not fire that month.

A day-of-week field using # can contain only one expression. For example, Quartz documents 3#1,6#3 as invalid. The expression 0 0 9 ? * 2#1 means 09:00 on the first Monday of each month.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to read the examples safely

These expressions illustrate the special-character rules, not every scheduling setting. In particular, the examples do not specify an application’s time zone or other trigger configuration. Validate an expression against the Quartz version used by your application before deploying it; the official API documents CronExpression as a parser and evaluator.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Cron syntax differs among schedulers. The definitions here follow the Quartz 2.5.1 API and Quartz 2.3.0 tutorial; a different scheduler, or a different Quartz release, may require checking its own documentation for compatibility and edge cases.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.