Last Day of Month
This expression approximates running on the last day of every month by running on days 28 through 31. Standard cron does not have a 'last day of month' feature, so this is a common workaround. Your script should check if tomorrow is the 1st to confirm it is actually the last day. Some cron implementations like Quartz support an L modifier for this purpose.
0 0 28-31 * * What is the cron expression for Last Day of Month?
The cron expression for Last Day of Month is 0 0 28-31 * *. This five-field cron schedule uses the format minute, hour, day-of-month, month, and day-of-week. This expression approximates running on the last day of every month by running on days 28 through 31. Standard cron does not have a 'last day of month' feature, so this is a common workaround. Your script should check if tomorrow is the 1st to confirm it is actually the last day. Some cron implementations like Quartz support an L modifier for this purpose. Common use cases include end-of-month reports and monthly invoice generation.
Field Breakdown
Example Next Run Times
- 1.
2026-04-28 00:00 - 2.
2026-04-29 00:00 - 3.
2026-04-30 00:00 - 4.
2026-05-28 00:00 - 5.
2026-05-29 00:00
Common Use Cases
- ✓ End-of-month reports
- ✓ Monthly invoice generation
- ✓ Account statement preparation
- ✓ Monthly cleanup
Frequently Asked Questions
Why does standard cron not support 'last day of month'?
Standard cron syntax only supports specific numbers, ranges, and step values for the day field. It has no concept of relative dates like 'last.' Extended cron implementations like Quartz and AWS EventBridge add L (last) support.
Will this run multiple times in months with more than 28 days?
Yes. In a 31-day month, this runs on the 28th, 29th, 30th, and 31st. Add a check in your script: if tomorrow's day is 1, it is the last day. Only execute the real work on the actual last day.
How do I handle February?
February has 28 days (29 in leap years). This expression will run on the 28th (and 29th in leap years) which covers the last day. Your script's date check handles the rest.