Cron on the last day of the month
The last day of the month in cron is 0 0 0 L * ? in Quartz and Spring (Unix cron has no L); this page lists the next runs, calculated in your browser.
Unix cron has no L. The usual workaround: 0 0 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && your-command (GNU date; % must be escaped in a crontab).
0 0 0 L * ?
cron(0 0 L * ? *)
Read by our parser as: At 12:00 AM (midnight), on the last day of the month. Open in the cron checker
Next 10 runs
Calculating in your browser...
- 1
- 2
- 3
At a glance
- Accepts
- Nothing to enter - the schedule is preset on the page
- Outputs
- The expression in Unix, Quartz/Spring and AWS form, plus its next 10 run times
- Where it runs
- Entirely in your browser, on your device
- What leaves your device
- Nothing - what you type stays in this tab
- Limits
- Run times use your browser's timezone or UTC; real schedulers can start a run late
- Account
- Not required - there is no sign-up
- Price
- Free, with no watermark and no usage cap
- Made by
- Visrut
What it means
L in the day-of-month field means the last day of the month, whatever its length: the 31st in October, the 30th in November, the 28th or 29th in February. 0 0 0 L * ? runs at midnight on that day in Quartz and Spring; AWS EventBridge accepts cron(0 0 L * ? *).
When this is the right schedule
Use it when the job must run before the month closes, such as end-of-month snapshots or reminders that something expires tonight.
When to pick something else
Look elsewhere when you're closing the month's books; that's often better at 00:00 on the 1st, when the month is truly over, using 0 0 1 * *.
Things to watch
Why 0 0 31 * * isn't the same
Day 31 doesn't exist in April, June, September or November, and cron doesn't move a missing day; it just skips the month. 0 0 30 * * misses February every year.
The Unix workaround, explained
Run on days 28 to 31 and let the command check whether tomorrow is the 1st. Inside a crontab line % starts the command's standard input unless escaped, so write \%d. On macOS/BSD use date -v+1d +\%d instead of -d tomorrow.
A few days before the end
Quartz and Spring support offsets: L-2 is the last day minus 2 (the 29th in a 31-day month). LW is the last weekday, covered on its own page.
Frequently asked questions
What does 0 15 10 L * ? mean?
At 10:15 AM on the last day of every month. It's one of the examples in Quartz's documentation.
Does Kubernetes support L for the last day?
Kubernetes documents standard 5-field syntax with *, ?, steps and the @ nicknames; L isn't among them. Use the 28-31 plus date check in the container instead.