Reading 0 0 * * *
Field by field: minute 0, hour 0, every day of the month, every month, every
day of the week. Hour 0 is midnight in cron’s 24-hour world, so the job fires once per day at
00:00 sharp on the scheduler’s clock. Most crons also accept @daily or
@midnight as a synonym — handy in a crontab, though some tools that merely
“accept cron syntax” (certain CI systems, libraries) do not implement the macros, so the
explicit five fields remain the portable spelling.
Which midnight? The timezone question
Cron fires by the clock of the machine it runs on. A Docker container defaults to UTC unless you set
TZ; a managed scheduler like AWS EventBridge is UTC by default too. That means
0 0 * * * on a UTC server runs at 09:00 in Seoul and at 19:00 in New York in winter (20:00 in summer).
The next-run preview above is computed in your browser’s timezone — useful for sanity
checking, but always confirm what timezone the target machine uses (date on Linux) before
assuming “midnight” means your midnight.
Daylight saving and midnight jobs
Midnight itself is rarely affected by DST — most regions shift clocks around 01:00–03:00, so 00:00
exists exactly once every day. That makes 0 0 * * * safer than, say, a 02:30 schedule,
which in DST regions is skipped once a year and ambiguous once a year. If you must schedule inside the
shift window on a machine with a DST timezone, know how your cron handles it (Vixie cron adjusts for
shifts of up to 3 hours so jobs are not lost or doubled) — or simply run the box in UTC.
The midnight stampede
Because 0 0 * * * is everyone’s default, shared databases, NFS servers and third-party
APIs get hammered at exactly 00:00. If your job is heavy or talks to shared services, shift it a little:
| Expression | Meaning |
|---|---|
7 0 * * * | 00:07 daily — same effect, off the peak |
0 3 * * * | 03:00 daily — a typically quiet hour |
0 0 * * 1-5 | Midnight, weekdays only |
0 0 * * 0 | Midnight every Sunday (weekly) |
0 0 1 * * | Midnight on the 1st of each month |
If you manage many machines, spreading the minute per host (a fixed random minute, not *!)
keeps the fleet from synchronising into one thundering herd.
Typical midnight workloads
- Database dumps and offsite backup uploads, before the day’s traffic begins.
- Rolling log files over to a new date-stamped file.
- Expiring stale sessions, tokens and temporary uploads.
- “Yesterday” aggregation jobs that need a completed calendar day of data.
For that last category, remember the aggregation window depends on the server’s timezone — a UTC midnight job aggregates UTC days, which may split your local business day in two.
FAQ
What is the cron expression for every day at midnight?
0 0 * * * — minute 0 of hour 0, every day of every month. Most cron implementations also accept the shorthand @daily (and @midnight), which expands to the same schedule.
Midnight in which timezone?
Whatever timezone the machine running cron uses. A server set to UTC runs "0 0 * * *" at 00:00 UTC, which may be the middle of the afternoon where you live. The preview on this page uses your browser’s timezone, so compare it with your server’s clock before relying on it.
Is midnight a good time for heavy jobs?
Often it is the worst-crowded time: an enormous number of systems schedule backups, rotations and reports at exactly 00:00. If your job talks to shared infrastructure, consider offsetting a few minutes (e.g. 7 0 * * *) or picking a genuinely quiet hour like 03:00 for your audience.
How do I run at midnight only on weekdays or only on the 1st?
Weekdays: 0 0 * * 1-5. First of the month: 0 0 1 * *. Last day of the month has no portable 5-field syntax — a common workaround is 0 0 28-31 * * plus a script check that tomorrow is the 1st.
Related: cron every hour · cron every 5 minutes · full cron expression generator