Regex and cron

Cron Expression for Every Day at 2 AM

Once a day at 02:00, in the quiet hours of the night. Copy it, check the next runs in your time zone and grab a snippet for your platform.

  • Free foreverNo trial, no paywall, no usage limits.
  • No sign-upOpen the page and start. We never ask for an email to use a tool.
  • PrivateEverything runs in your browser. Your input is never uploaded or stored on our servers.
  • Works offlineOnce the page has loaded, the tool keeps working without a connection.

Cron expression

0 2 * * *
Customize
0minuteMinute: at minute 0 (on the hour)2hourHour: at hour 2 (2 AM)*day (month)Day of month: every day of the month*monthMonth: every month*day (week)Day of week: every day of the week

Once a day at 02:00, in the quiet hours of the night.

Time zone
Run times, the week view and the snippets use this zone. It starts as your device's zone.
Show times as 9:00 AM instead of 09:00.

Next runs

Each run in your selected time zone, with the same moment in UTC. Daylight saving changes follow cronie, the cron on most Linux servers.
Copy run times (ISO 8601)

Next 7 days

Each square is one hour of local time in your selected zone. Darker squares have more runs. Daylight saving changes are not drawn.

Use it on your platform

Copy-ready config for each scheduler. Dialects differ: some only run in UTC, some can't do seconds, Cloudflare and AWS number weekdays from 1 = Sunday. The snippet handles the conversion and says what changed.
A line for crontab -e on Linux or macOS (Vixie cron, cronie).on.schedule for a workflow, with the timezone field GitHub added in March 2026 (UTC when omitted).A CronJob manifest with the timeZone field (Kubernetes 1.27+).Cron Triggers in wrangler.toml for a Worker. Runs in UTC and numbers weekdays from 1 = Sunday.crons in vercel.json plus the route it calls. Runs in UTC.EventBridge Scheduler (any time zone, recommended by AWS) and a legacy EventBridge scheduled rule (UTC).A .timer unit with OnCalendar=, the systemd replacement for cron.
Runs as writtenRuns in your time zone
crontab -e
Copy crontab -eDownload my-job.crontab
# ┌───────────── minute (0–59)
# │ ┌─────────── hour (0–23)
# │ │ ┌───────── day of month (1–31)
# │ │ │ ┌─────── month (1–12)
# │ │ │ │ ┌───── day of week (0–6, Sunday = 0)
# │ │ │ │ │
# * * * * *  command
CRON_TZ=UTC
0 2 * * *  /path/to/my-job.sh >> /var/log/my-job.log 2>&1
  • CRON_TZ=UTC is honored by cronie (Fedora, RHEL, Arch). Other cron daemons ignore it and use the server's time zone, so check timedatectl first.
  • Edit with crontab -e. Cron starts the next run even if the last one is still going; wrap the command in flock -n /tmp/my-job.lock to prevent overlaps.

Need scheduled jobs, queues and monitoring that never miss a run? Talk to our team

Quick answer

The cron expression for every day at 2am is 0 2 * * *. The minute field is 0 and the hour field is 2, so the job runs once a night at 02:00 in the scheduler's time zone. It is a popular slot for backups and maintenance, but in zones with daylight saving time 02:00 is skipped or repeated on one night a year each, so a UTC server or a time such as 04:30 avoids surprises.

  • Live next runs
  • Any time zone
  • Field-by-field breakdown
  • Seven platform snippets
  • Daylight saving aware

How to use this schedule

  1. 1Copy 0 2 * * * with the Copy expression button.
  2. 2Check Next runs in your time zone to confirm it fires when you expect, including around daylight saving changes.
  3. 3Pick your platform under Use it on your platform and copy the ready-made crontab line, workflow, manifest or timer.
  4. 4Need a different time or day? Click Customize to open it in the cron expression generator and change any field.

Why is 2 AM the riskiest time for a cron job?

Most daylight saving changes happen in the small hours of a Sunday, and 02:00 sits right in the middle of them:

RegionSpring forwardFall back
United States and Canada02:00 jumps to 03:0002:00 goes back to 01:00
Central Europe (Berlin, Paris)02:00 jumps to 03:0003:00 goes back to 02:00
United Kingdom01:00 jumps to 02:0002:00 goes back to 01:00

In New York or Berlin, 02:00 doesn't exist on the spring-forward night. Cronie, the cron on most Linux servers, notices the jump and runs a fixed-time job like 0 2 * * * once, right after it, at 03:00. In Berlin the fall-back night repeats 02:00–02:59, and cronie runs the job only at the first 02:00, so it doesn't run twice. Other schedulers behave differently: GitHub Actions moves a run in the skipped hour to the next valid time, and some libraries simply skip it. Eastern Europe changes an hour later still, at 03:00 and 04:00.

If a nightly job must run exactly once at a predictable moment, keep the server in UTC or pick a time outside the 01:00–04:00 window, such as 30 0 * * * or 30 4 * * *.

What should run at 2 AM every night?

The small hours are when traffic is lowest for a single-region product, so they suit work that is heavy but not urgent: database backups, log rotation, vacuuming or reindexing tables, rebuilding search indexes and caches, or precomputing the reports people will open in the morning.

"Night" only means something in one time zone, though. On a server set to UTC, 0 2 * * * runs at 9 or 10 PM the previous evening in New York and at 07:30 in India, which is peak time for users there. Pin the schedule to the zone your traffic lives in with CRON_TZ on cronie, timeZone on a Kubernetes CronJob or timezone: in a GitHub Actions schedule. Then check that the job finishes well before the morning peak: a backup that starts at 02:00 and takes five hours is still running when people log in. Staggering several nightly jobs (0 2, 20 2, 40 2) keeps them from fighting over the same disk and database.

What does each field in 0 2 * * * mean?

FieldValueAllowedMeaning
Minute00–59at minute 0 (on the hour)
Hour20–23at hour 2 (2 AM)
Day of month*1–31every day of the month
Month*1–12, JAN–DECevery month
Day of week*0–7 (0 and 7 are Sunday), SUN–SATevery day of the week

Read together: Once a day at 02:00, in the quiet hours of the night.

How do I adjust 0 2 * * * to my own schedule?

Small edits to 0 2 * * * cover most real-world needs:

ExpressionWhat it does
30 4 * * *04:30 every night, after the US and European clock changes
17 2 * * *02:17, off the busy top of the hour
0 2 * * 02 AM on Sundays only, a weekly maintenance window
0 2 * * 1-52 AM Monday to Friday, the nights after Sunday through Thursday
0 2,14 * * *2 AM and 2 PM, twice a day

Need something else? Click Customize at the top of the page to open this schedule in the cron expression generator and change any field.

Related schedules: Every day at midnight · Every day at 9am · Every Sunday · Every week

Browse all schedules in the cron schedule library.

How do I run 0 2 * * * in crontab, GitHub Actions, Kubernetes and the cloud?

PlatformWrite it asTime zone
Linux crontab0 2 * * *Server's time zone; CRON_TZ= in cronie
GitHub Actions- cron: "0 2 * * *"UTC by default; add timezone: (IANA name)
Kubernetes CronJobschedule: "0 2 * * *"Set timeZone: (1.27+)
Cloudflare Workers0 2 * * *UTC only; numbers weekdays from 1 = Sunday, so use names
Vercel Cron Jobs0 2 * * *UTC only; Hobby runs it within the hour (±59 min)
AWS EventBridge Schedulercron(0 2 * * ? *)Takes a time zone; legacy scheduled rules are UTC only
systemd timerOnCalendar=*-*-* 02:00:00Add a zone after the time, e.g. Europe/London

In a crontab (crontab -e), the full line looks like this:

0 2 * * *  /path/to/job.sh >> /var/log/job.log 2>&1

The live panel at the top of the page builds complete, copy-ready files for each platform (workflow, CronJob manifest, wrangler.toml, vercel.json, AWS CLI and systemd units) and can shift the schedule to UTC for platforms that need it.

What can go wrong with 0 2 * * *?

  • On the spring-forward night in New York or Berlin, 02:00 doesn't exist. Cronie runs the job right after the jump, at 03:00; other schedulers may skip it, so check yours.
  • In Central Europe the fall-back night repeats 02:00–02:59. Cronie runs a fixed-time job once, but a job with * in the minute or hour field, such as */15 * * * *, runs in both copies of the hour.
  • On a UTC server, 0 2 * * * is 9 or 10 PM the previous evening in New York, which is not a quiet hour there.
  • Long backups that start at 02:00 can overlap the next night's run or the morning peak. Wrap them in flock -n and alert if one runs past its window.
  • This fires between 01:00 and 04:00, the window where the US and Europe change their clocks. On the spring-forward night cronie runs it right after the jump; on the fall-back night it runs once. Run the server on UTC, or move the job out of that window.

Frequently asked questions

0 2 * * *. Minute 0, hour 2, and asterisks for the other fields, so it runs at 02:00 every night in the scheduler's time zone.
With cronie on Linux, yes. In places like New York or Berlin 02:00 doesn't exist that night, so cronie runs fixed-time jobs right after the clocks jump, at 03:00. Some other schedulers skip the run, and GitHub Actions moves it to the next valid time.
Not with cronie. When 02:00 to 02:59 repeats, as it does in Central Europe, cronie runs a fixed-time job such as 0 2 * * * only once. Jobs with an asterisk in the minute or hour field do run in both copies of the hour.
Any time outside 01:00 to 04:00 local time, such as 00:30 or 04:30, avoids the US and European clock changes. Running the server in UTC removes the problem entirely.

Last updated by the Playxoft engineering team.

From the engineers who built this tool

Need scheduled jobs that never miss a run?

Cron is the easy part. Retries, overlapping runs, time zones, queues and alerts when a job silently stops are where schedules break. We build background job systems you can trust, and we will review your setup for free.

More free tools

See all tools

Regex Tester

Test regex live with highlighted matches, plain-English explanations and code export.

Open tool

Cron Expression Generator

New

Build and explain cron schedules, see the next runs in any time zone, copy platform snippets.

Open tool

SQL Formatter

Beautify or minify SQL in 12 dialects, with keyword case, indent and line:column errors.

Open tool

cURL to Python Converter

New

Convert cURL commands into Python requests or httpx code with params, json, files and auth.

Open tool

cURL to Fetch Converter

New

Turn any cURL command into JavaScript fetch() code with headers, JSON, forms and auth.

Open tool

cURL to Axios Converter

New

Convert cURL commands into an Axios request config with params, data, auth and timeouts.

Open tool