Skip to content
Unix cron100% Client-Side

Cron Expression for Daily at Midnight

0 0 * * *At 12:00 AM

The Unix cron expression "0 0 * * *" runs a task daily at midnight. Preview the next run times in your timezone, read the plain-English translation, and copy ready-to-paste snippets for crontab, Node.js, GitHub Actions, and AWS EventBridge.

Live playground

  • Min0
  • Hour0
  • DOM*
  • Month*
  • DOW*

At 12:00 AM

Unix cron · evaluated in UTC

24-hour view

Hover a highlighted hour for precise timestamps. Showing the next 50 executions.

Upcoming runs

Timezone

Runs are simulated in the selected IANA timezone. Auto-detected from your browser on first load.

Field breakdown

How each field of 0 0 * * * is interpreted in the Unix cron format.

Field breakdown of 0 0 * * *
FieldValueAllowedStatus
Minute00-59Valid
Hour00-23Valid
Day of Month*1-31Valid
Month*1-12 or JAN-DECValid
Day of Week*0-7 or SUN-SAT (0 and 7 = SUN)Valid

Use “0 0 * * *” in real code

Copy-paste configurations for the most common schedulers, converted to each platform’s dialect where needed.

import cron from 'node-cron';

cron.schedule('0 0 * * *', () => {
  console.log('Running task...');
});

Running “0 0 * * *” in production

Midnight jobs: the classic nightly batch

0 0 * * * is the most-written cron line in history, and its residents are the batch workload: full database backups and mysqldump/pg_dump runs; log rotation and archival (logrotate's own default); nightly ETL that folds the day's events into warehouse tables; retention sweeps that delete rows past their window; search-index rebuilds; and end-of-day financial or usage snapshots. Midnight is chosen because it is the lowest-traffic hour for most products — but it is also when every other nightly job runs, so databases see a synchronized backup-and-vacuum storm that operations teams know by heart.

Two failure modes dominate midnight jobs. First, duration creep: a backup that took 20 minutes in year one takes three hours in year four, and now overlaps morning traffic — alert on runtime, not just exit code. Second, DST: on machines keeping local time, the 2 AM transition means one 23-hour day and one 25-hour day per year; a midnight job still fires daily, but anything scheduled between 1 and 3 AM can fire twice or not at all. UTC servers (the modern default) are immune; the timezone switcher above shows the difference for any zone you pick.

Nightly schedules on modern platforms

Kubernetes takes "0 0 * * *" directly, but the mature pattern for nightly batch is concurrencyPolicy: Forbid plus a generous activeDeadlineSeconds, because a nightly job that wedges should not still be running when the next one fires. systemd's OnCalendar=midnight (or the explicit *-*-* 00:00:00) pairs with Persistent=true — the setting that catches up a missed fire after downtime, which plain cron never does. Vercel Cron's canonical example is a daily schedule in vercel.json — crons run in UTC, and Hobby plans are limited to once-per-day precision, which is exactly this recipe's cadence.

The managed-cloud version is usually better than cron for nightly work not because of the schedule but because of the surrounding contract: AWS EventBridge cron(0 0 * * ? *) into a Lambda or Step Functions state machine gives retries, DLQs, and observability that a bare crontab line does not. The expression is the same five fields you validate above; what changes is who guarantees the run. For anything that must not silently skip — billing, backups — that guarantee is the actual product feature.

Frequently asked questions

What does the cron expression "0 0 * * *" mean?

"0 0 * * *" is a Unix cron expression that means: At 12:00 AM. It contains 5 fields — Minute (0), Hour (0), Day of Month (*), Month (*), Day of Week (*) — and works in any scheduler that accepts the Unix cron format.

How does "0 0 * * *" behave in UTC versus local time?

The classic cron daemon interprets every field in the machine's local timezone (from /etc/timezone or the TZ environment variable). If the server runs in UTC the schedule fires in UTC; otherwise shift the hours accordingly. Modern cronie also supports CRON_TZ to pin a single job to UTC.

What happens if the machine is offline when "0 0 * * *" is due?

Classic cron does not catch up missed runs: if the server is down at the fire time, that execution is skipped until the next match. Guard the command with an idempotency check, or use anacron or a scheduler with missed-run handling when catch-up behavior matters.

Does 0 0 * * * mean midnight at night or noon?

Midnight at the start of the day: hour 0, minute 0 — 00:00, the boundary between one day and the next. Noon is 0 12 * * * (hour 12). The 24-hour clock maps directly onto cron's hour field, so 3 AM is 3, 3 PM is 15, and there is no AM/PM ambiguity — which is exactly why getting 11:30 PM wrong as 0 11 * * * (11 AM) is such a classic incident-report paragraph.

What happens if the server is down at midnight when a daily cron job should run?

Nothing — the run is simply skipped forever. Classic cron has no catch-up: if the machine is off, suspended, or the cron daemon is dead at 00:00, that execution never happens and the next chance is the following midnight. That is why production nightly jobs use anacron or systemd timers with Persistent=true (both replay missed runs after boot), or managed schedulers with retry policies — and why idempotent job design matters whenever catch-up is possible.

About the “0 0 * * *” schedule

0 0 * * * is the Unix cron way to say “At 12:00 AM”. The simulator above evaluates it entirely in your browser — the timeline, the next-run table, and the timezone switcher all run client-side, so you can paste production schedules without them ever leaving your machine.

Every page in this directory follows the same structure: a plain-English translation, a per-field breakdown, platform-specific snippets, and a timezone-aware simulator. Move between the related intervals below to compare dialects, and validate one final time in the simulator with your own timezone before shipping.

Adjacent intervals and the same schedules expressed for other platforms.