Skip to content
Unix cron100% Client-Side

Cron Expression for Daily at 2 AM

0 2 * * *At 02:00 AM

The Unix cron expression "0 2 * * *" runs a task daily at 2 am. 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
  • Hour2
  • DOM*
  • Month*
  • DOW*

At 02: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 2 * * * is interpreted in the Unix cron format.

Field breakdown of 0 2 * * *
FieldValueAllowedStatus
Minute00-59Valid
Hour20-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 2 * * *” 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 2 * * *', () => {
  console.log('Running task...');
});

Running “0 2 * * *” in production

2 AM: the quiet window that daylight saving deletes

0 2 * * * owns the deepest trough of the traffic day — after the late-night users, before the first commuters — and hosts the medium-weight nightly work: incremental database backups, log compaction, index maintenance, and the second wave of ETL that the midnight jobs fed. The choice of 2 rather than midnight is usually sequencing: midnight belongs to the heavy backups, 1 AM to their verification, and 2 AM to the dependents. On a UTC server all of this composes cleanly and the schedule is boring, which is the goal.

Boring is exactly what 2 AM is not, on machines keeping local time in a DST zone. The US spring-forward transition jumps the clock from 1:59:59 to 3:00:00 — the 2 AM hour does not exist — so 0 2 * * * simply never fires that day: one missed backup per year, discovered eleven months later if nobody alerted. The fall-back transition repeats the hour, and the same line fires twice: two compactions, two increments, occasionally two alert emails for one incident. EU zones deform differently (1 AM is the casualty), but the lesson is identical: wall-clock schedules near the transition hour are structurally unreliable once a year.

Making a 2 AM schedule trustworthy: UTC, catch-up, idempotency

The structural fixes, in order of preference: run the server in UTC so the expression means one instant per day, every day (the modern container default, and the reason DST incidents have quietly faded); if local time is mandatory, use a scheduler with catch-up semantics — systemd timers with Persistent=true replay a missed fire at next boot, anacron exists for exactly the daily-and-missed case, and Kubernetes' startingDeadlineSeconds decides whether a missed fire still counts within its window. Plain cron offers none of this: a fire that lands in a deleted hour is gone, and a fire in a repeated hour is duplicated.

Duplicated is the more dangerous of the two, because it arrives silently. The defense is idempotent job design: key each run on the date it belongs to, record that key in a run ledger before work starts, and refuse or resume rather than repeat. That pattern costs an hour to build, survives manual re-runs and deploys as well as DST, and converts 'did the 2 AM job run twice?' from an investigation into a SELECT. The simulator above shows the fire times in any zone — switch between UTC and a DST zone and step across a transition night to see the deletion and the duplication with your own eyes.

Frequently asked questions

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

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

How does "0 2 * * *" 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 2 * * *" 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.

Why did my 2 AM cron job not run at all one day in March?

Your server keeps local time in a DST zone, and the spring-forward transition deleted the 2 AM hour — the clock moved from 1:59:59 to 3:00:00, so the schedule's target time never occurred. Plain cron does not replay missed fires. The durable fixes: run the server in UTC, use systemd Persistent=true or anacron for catch-up, or move the job off the transition hour (jobs at 4 AM and later are structurally safer than 2-3 AM in DST zones).

Why did my 2 AM job run twice in one night?

The fall-back transition repeated the 2 AM hour: clocks moved from 1:59:59 back to 1:00:00 (US zones), so local time 02:00 occurred twice and the daemon fired on both occurrences. The job ran twice because the schedule said so — twice a year. Make the job idempotent with a date-keyed run ledger so the second fire becomes a no-op, or eliminate the class of problem entirely by keeping the server in UTC.

About the “0 2 * * *” schedule

0 2 * * * is the Unix cron way to say “At 02: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.