Cron on the Last Day of Every Month

Schedule a cron job on the last day of each month using 0 23 28-31 * *. Field breakdown explaining the conditional last-day workaround approach.

Cron Expression

0 23 28-31 * *

Field Breakdown

FieldValueMeaning
Minute0At 0
Hour23At 23
Day of Month28-31From 28 to 31
Month*Every month (1–12)
Day of Week*Every day of the week (Sun–Sat)

Detailed Explanation

The cron expression 0 23 28-31 * * schedules a task to run at 11:00 PM on days 28 through 31 of every month. Combined with a shell check, this effectively targets the last day of each month.

Field-by-field breakdown:

  • 0 (Minute): At minute 0. The task fires at the top of the hour.
  • 23 (Hour): At hour 23 (11 PM). The task runs late in the evening, near the end of the day.
  • 28-31 (Day of Month): Days 28 through 31. This range captures all possible last days of the month (28 for February, 30 for April/June/September/November, 31 for the rest).
  • * (Month): Every month from January through December. No restriction on which month.
  • * (Day of Week): Every day of the week from Sunday through Saturday. No restriction on the day.

Important: Standard cron does not have a native "last day of month" field. This expression will fire on days 28-31, so you should wrap your command with a shell check like [ "$(date +\%d -d tomorrow)" = "01" ] && your_command to ensure it only runs on the actual last day. Without this guard, it will run multiple times at the end of months with 29, 30, or 31 days. The 11 PM timing ensures all of the day's data is available for processing. This expression is supported by standard cron on Linux/macOS, as well as cloud services like AWS CloudWatch, Google Cloud Scheduler, and GitHub Actions.

Use Case

Perfect for generating end-of-month billing invoices and financial statements that need to capture the complete month's transactions.

Try It — Interactive Builder

at min 0, at hour 23, on day 28-31

**/5*/10*/15*/300
**/2*/3*/6*/120
*1151,15*/2
*11,4,7,101,7
*1-50,615

Next 10 Executions

1.Sat, Mar 28, 2026, 11:00 PM
2.Sun, Mar 29, 2026, 11:00 PM
3.Mon, Mar 30, 2026, 11:00 PM
4.Tue, Mar 31, 2026, 11:00 PM
5.Tue, Apr 28, 2026, 11:00 PM
6.Wed, Apr 29, 2026, 11:00 PM
7.Thu, Apr 30, 2026, 11:00 PM
8.Thu, May 28, 2026, 11:00 PM
9.Fri, May 29, 2026, 11:00 PM
10.Sat, May 30, 2026, 11:00 PM

Ctrl+Shift+C to copy expression

Customize this expression