Skip to content
14 changes: 14 additions & 0 deletions increments/OCPS-increment-1.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,17 @@ The `W` character can be used in the `Day of Month` field to find the closest we
* If the 1st is a Saturday, it triggers on **Monday the 3rd**, as moving to the previous month is not allowed.

* **Constraint:** The `W` character is a modifier for a single day and cannot be used with ranges or lists. For example, `1-15W` is an invalid pattern.

#### 4.3.1. Behavior with Non-Existing Days

When the `W` modifier is used with a day number that does not exist in a particular month (e.g., `31W` in February), the pattern **will not match any date in that month**. The job will simply not be scheduled to run during those months.

* **Example:** `0 12 31W * *` triggers at noon on the nearest weekday to the 31st.
* In months with 31 days (Jan, Mar, May, Jul, Aug, Oct, Dec), it triggers as expected.
Comment thread
Hexagon marked this conversation as resolved.
Outdated
* In months with fewer days (Feb, Apr, Jun, Sep, Nov), the pattern does not match and the job does not run.

To schedule on the last weekday of every month regardless of month length, combine `L` and `W` as `LW`:

* **Example:** `0 12 LW * *` triggers at noon on the last weekday of the month.
* If the last day is a weekday, it triggers on that day.
* If the last day is a weekend, it triggers on the preceding Friday.
Comment thread
Hexagon marked this conversation as resolved.