Cron expression for the last day of the month

ExamplesPlanner

Standard cron has no last-day-of-month token. The closest is 0 0 28-31 * * plus a one-line date check so the command only runs on the final day — the exact crontab is on this page.

Paste an expression or choose a starting schedule below.

Select a field to edit it.

Start with:
Add to planner

Schedule summary

At 12:00 AM, between day 28 and 31 of the month
Build a schedule

Use the fields above to edit this expression, or replace it with a simple schedule here.

Upcoming runs

The next 50 runs, shown in the schedule timezone and your local time.

Calculating…

About 0 0 28-31 * *

0 0 28-31 * * fires at midnight on the 28th, 29th, 30th and 31st whenever those dates exist — up to four times a month, not once. To act only on the real last day, keep that schedule and let the command check whether tomorrow is the 1st; the exact crontab below does that with GNU date (on macOS use date -v+1d +\%d instead of date -d tomorrow +\%d). Quartz-style schedulers accept L in the day field instead.

Cron reads the five fields as minute hour day month weekday. For this schedule that breaks down as:

FieldPositionMatches
0minute0
0hour0
28-31day of month28–31
*monthevery month
*day of weekevery day of the week

New to cron? Read the syntax reference or the FAQ.

Use it in crontab or GitHub Actions

The single line below is the closest cron gets, not the exact schedule (see above). The crontab timezone setting requires a compatible daemon such as Cronie. GitHub Actions defaults to UTC and accepts a timezone on each schedule. For other timezones, Kubernetes, EventBridge Scheduler, or Vercel, use the export menu in the calculator above.

crontab

# At 12:00 AM, between day 28 and 31 of the month
# CRON_TZ requires a cron implementation that supports it, such as Cronie.
CRON_TZ=UTC
0 0 28-31 * * /path/to/command

GitHub Actions workflow

# At 12:00 AM, between day 28 and 31 of the month
on:
  schedule:
    - cron: '0 0 28-31 * *'
      timezone: "UTC"

Exact version for crontab

0 0 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && /path/to/command

Monthly & yearly schedules

Build a custom cron expression →