L in day-of-month — last day
0 0 L * ? # Quartz: midnight on the last day of every month cron(0 0 L * ? *) # AWS: same
This handles months of different lengths automatically — fires on the 28th of February (29th in leap years), 30th of April, 31st of January, etc.
L in day-of-week — last weekday of the month
Format: dayL means "last day-of-week of the month":
| Expression | Meaning |
|---|---|
0 0 0 ? * 6L | Last Friday of every month at midnight (Quartz uses 1=Sun, so 6=Fri) |
0 0 0 ? * 1L | Last Sunday of every month |
0 0 17 ? * 6L | Last Friday of every month at 5 PM |
0 0 0 ? * L | Last day-of-week (Saturday by default) |
L with offset — Nth-from-last
Some implementations support L-N meaning "N days before the last day":
0 0 0 L-1 * ? # Day before the last day of every month 0 0 0 L-3 * ? # 3 days before the last day
This is less universally supported — verify with your specific scheduler.
Unix cron workaround
Unix cron has no native "last day of month" support. Common workarounds:
# Approach 1: schedule for 28-31, gate inside the script 0 0 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && /path/to/script.sh # Approach 2: schedule on day 1, run yesterday's task 0 1 1 * * /path/to/script.sh --process-yesterday
The first approach is more direct ("run on last day"); the second is often more robust because it treats the schedule as "run once per month, after the prior month is complete."
Last weekday of the month (Unix)
To run on the last weekday, gate on day-of-week inside the script:
# Try days 25-31, only run if it's the last Friday 0 17 25-31 * 5 [ "$(date -d 'next Friday' +\%d)" -le 7 ] && /path/to/script.sh
Or just use Quartz / AWS Scheduler — much cleaner.
Platform support summary
| Platform | Supports L? |
|---|---|
| Quartz | Yes (full) |
| AWS EventBridge / Scheduler | Yes (full) |
| Spring @Scheduled | Yes (uses Quartz cron parser) |
| Unix crontab | No |
| Kubernetes CronJob | No (uses Unix cron) |
| GitHub Actions | No (uses Unix cron) |
| Azure Functions Timer | No (uses NCRONTAB) |
| Jenkins | No |