0 23 28-31 * *
Cron reads this as: at 23:00, on day-of-month 28 through 31.
Next 5 runs
Cron alone cannot express this schedule, so the expression deliberately matches several days and a shell test picks the right one. The times below are the days cron will wake up; the guard shown further down lets exactly one of them through.
Computed in your browser's local time zone. Cron itself evaluates against the server's zone, which on most cloud hosts is UTC — see time zones & DST if that distinction matters here.
- Calculating…
When to use this schedule
Month-end closing, final reconciliation, generating a statement that must cover the complete month. This is one of the few common schedules that standard Unix cron cannot express directly.
What to watch out for
There is no L token in standard cron, and no month has a consistent last day — so 0 23 31 * * silently skips February, April, June, September and November. The portable approach is to narrow cron to the only four candidate days and let the shell decide which one is actually the last: schedule 28-31 and guard the command with a test on tomorrow's date. Quartz users can write 0 0 23 L * ? directly instead.
The crontab line
This schedule needs a shell guard, because cron alone cannot express it. The expression narrows cron to the candidate days and the test lets exactly one of them through:
0 23 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] /usr/local/bin/your-job.sh
The \% escaping is a crontab requirement — an unescaped % is turned into a
newline and everything after it is fed to the command on standard input. See the
crontab guide for the full rule.
Related schedules
| Expression | Schedule |
|---|---|
0 0 23 L * ? | The Quartz equivalent |
0 23 31 * * | The broken version — skips 5 months |
0 0 1 * * | First of the month instead |
Build your own
Need something this page does not cover? Compose it field by field in the visual builder, or paste an expression you already have into the explainer for a per-field breakdown. The examples library collects sixty schedules in one place, and the guides cover crontab syntax, time zones, troubleshooting and production practices.