Cron expression for every day at midnight

At 12:00 AM

0
minute
0
hour
*
day (month)
*
month
*
day (week)

At 12:00 AM

Try this expression in the interactive tool:

Open in cron explainer →

Next 10 scheduled runs

#1Fri, 17 Apr 2026, 00:00
#2Sat, 18 Apr 2026, 00:00
#3Sun, 19 Apr 2026, 00:00
#4Mon, 20 Apr 2026, 00:00
#5Tue, 21 Apr 2026, 00:00
#6Wed, 22 Apr 2026, 00:00
#7Thu, 23 Apr 2026, 00:00
#8Fri, 24 Apr 2026, 00:00
#9Sat, 25 Apr 2026, 00:00
#10Sun, 26 Apr 2026, 00:00

Common use cases

Midnight is the single most common time for daily cron jobs. It's the conventional start of a new "day" in computing, and running jobs at this boundary keeps date-partitioned logs, backups, and reports aligned to calendar dates.

Typical midnight jobs include full database backups, log rotation and compression, daily analytics aggregation, and cleanup tasks like purging expired sessions, temporary files, or soft-deleted records past their retention period.

The main risk with midnight scheduling is the "thundering herd" problem — if every job on a server is scheduled for 00:00, they all compete for resources simultaneously. A common mitigation is staggering jobs by a few minutes.

Platform-specific syntax

crontab
0 0 * * * /path/to/script.sh
AWS EventBridge
cron(0 0 * * ? *)
GitHub Actions
schedule:
  - cron: '0 0 * * *'  # Midnight UTC
Kubernetes
schedule: "0 0 * * *"

Technical breakdown

The expression 0 0 * * * has five fields: minute=0, hour=0, day (month)=*, month=*, day (week)=*. At 12:00 AM.

Frequently asked questions

Is midnight 0 0 or 0 24?
Always 0 0. The hour field in cron uses 0-23 (24-hour format). There is no hour 24. Midnight is hour 0, noon is hour 12.
What timezone does midnight refer to?
The timezone of the system running the cron daemon. On most servers this is UTC. AWS uses UTC, GitHub Actions uses UTC, and Kubernetes uses the timezone of the kube-controller-manager (UTC by default, configurable via .spec.timeZone since v1.25).