Cron expression for every day at midnight
At 12:00 AM
At 12:00 AM
Try this expression in the interactive tool:
Open in cron explainer →Next 10 scheduled runs
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
0 0 * * * /path/to/script.shcron(0 0 * * ? *)schedule:
- cron: '0 0 * * *' # Midnight UTCschedule: "0 0 * * *"Technical breakdown
The expression 0 0 * * * has five fields: minute=0, hour=0, day (month)=*, month=*, day (week)=*. At 12:00 AM.