Skip to content

Cron on Day 28 of Every Month: 0 0 28 * * Explained

0 0 28 * * Day 28 of every month at 00:00 monthly

The cron expression 0 0 28 * * runs a job at 00:00 on day 28 of every month. The third field is day-of-month; fixing it to 28 while keeping month and day-of-week as wildcards gives a monthly cadence anchored to a calendar date rather than to a weekday. Monthly slots drive billing runs, invoice generation, partition rotation, subscription renewals and compliance archives. Months with fewer than 28 days simply never match, so the job skips them — February is the usual casualty for day-29/30/31 schedules; day 28 exists in every month, so this expression never skips. If your real requirement is 'the last day of the month', standard five-field cron cannot express it directly — portable options are scheduling days 28-31 and guarding the script with a date check, or using Quartz's 'L' wildcard where available. Midnight execution also interacts with daylight saving and with month boundaries in UTC-versus-local time, so pin the time zone explicitly on shared infrastructure. The breakdown below explains each field, lists the next five run times computed at build time, and converts the schedule to Quartz, Spring, Kubernetes and EventBridge syntax.

Advertisement
Ad slot · ref-top

Field-by-field breakdown

FieldValueMeaning
minute0only at minute 0
hour0only at hour 0
day-of-month28only at day-of-month 28
month*every month (wildcard, no restriction)
day-of-week*every day-of-week (wildcard, no restriction)

Next 5 run times (UTC)

Computed at build time; cross-check against your server's time zone before deploying.

  • 2026-12-28 00:00 UTC
  • 2027-01-28 00:00 UTC
  • 2027-02-28 00:00 UTC
  • 2027-03-28 00:00 UTC
  • 2027-04-28 00:00 UTC

When to use this schedule

  • Billing runs, invoice generation and subscription renewals anchored to a calendar date.
  • Partition rotation and archive compaction for time-series tables that grow by month.
  • Compliance exports and retention-policy enforcement that auditors expect on a fixed monthly date.
  • Reconciling ledger balances against upstream financial systems at month start.

Equivalent syntax

The same schedule expressed for popular schedulers and platforms:

Crontab (5-field)
0 0 28 * * /usr/local/bin/job.sh   # Day 28 of every month at 00:00
Quartz (6/7-field)
0 0 0 28 * ?   # Quartz (Java): 6-7 fields, leading seconds, '?' when day-of-week is set
Spring @Scheduled
0 0 0 28 * *   # Spring @Scheduled: 6 fields, leading seconds, day names accepted
Kubernetes CronJob
0 0 28 * *   # Kubernetes CronJob schedule field: standard 5-field syntax
AWS EventBridge
cron(0 0 28 * ? *)   # AWS EventBridge: 6 fields incl. year, '?' required in one day field

Caveats & gotchas

  • Cron evaluates schedules in the server's local time zone; set CRON_TZ (cronie) or TZ (containers) explicitly on shared or distributed infrastructure.
  • When both day-of-month and day-of-week are restricted, standard cron ORs them; keep one of the two as '*' unless you want that behavior.

Verify your schedule

After installing the schedule, verify it end to end instead of trusting the crontab line. Run 'crontab -l' to confirm the entry survived editing, then execute the command manually with the same user and environment to catch PATH and permission problems — cron runs with a minimal environment, so absolute paths and explicit SHELL/PATH declarations prevent the classic 'works in my terminal, fails in cron' bug. Watch the daemon log ('grep CRON /var/log/syslog' on Debian/Ubuntu, 'journalctl -u cron' or '-u crond' on systemd hosts) to confirm the trigger fires at the expected times, and redirect the job's own output to a log file with 2>&1 so failures are not swallowed by mail. Finally, cross-check the next run times listed on this page against your server's time zone before declaring the schedule correct.

Frequently asked questions

What is the cron expression for day 28 of every month?

0 0 28 * * — day-of-month pinned to 28, hour and minute at 0, month and day-of-week wildcarded.

How do I run a job on the last day of every month?

Standard cron has no 'L' wildcard. Schedule '0 0 28-31 * *' and have the script exit unless tomorrow is the 1st, or use Quartz which supports 'L' natively.

Does day 28 exist in every month?

Yes — day 28 is present in all months including February, so this schedule never skips.

Advertisement
Ad slot · ref-in-article

Try the Cron Parser

Decode cron schedules and preview the next run times.

Open tool →