Regex and cron

Cron Expression for Every 4 Hours

At minute 0 of every fourth hour (00:00, 04:00, 08:00, 12:00, 16:00 and 20:00), every day. 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 */4 * * *
Customize
0minuteMinute: at minute 0 (on the hour)*/4hourHour: every 4 hours: 00:00, 04:00, 08:00, 12:00, 16:00 and 20:00*day (month)Day of month: every day of the month*monthMonth: every month*day (week)Day of week: every day of the week

At minute 0 of every fourth hour (00:00, 04:00, 08:00, 12:00, 16:00 and 20:00), every day.

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 */4 * * *  /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 4 hours is 0 */4 * * *. The 0 in the minute field runs the job on the hour, and */4 in the hour field keeps every fourth hour from 0 to 23, so it fires at 00:00, 04:00, 08:00, 12:00, 16:00 and 20:00: six evenly spaced runs a day. To move all six slots, start the step later, as in 0 2-22/4 * * *.

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

How to use this schedule

  1. 1Copy 0 */4 * * * 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.

What does 0 */4 * * * mean?

The hour field */4 takes the hours 0 to 23 and keeps every fourth one: 0, 4, 8, 12, 16, 20. The minute field is fixed at 0, so each run lands exactly on the hour. Because 24 divides evenly by 4, the last gap of the day (20:00 to the next midnight) is also four hours, unlike */5 or */7, which leave a short gap before midnight.

There are only four distinct phases, so it is easy to pick one that suits your traffic:

ExpressionRuns atRuns a day
0 */4 * * *00, 04, 08, 12, 16, 206
0 1-23/4 * * *01, 05, 09, 13, 17, 216
0 2-22/4 * * *02, 06, 10, 14, 18, 226
0 3-23/4 * * *03, 07, 11, 15, 19, 236

Write the offset as a range, not 2/4: Quartz and Kubernetes accept a step after a single number, but Vixie cron and cronie (Linux crontab) reject it. To keep the job off the top of the hour as well, change the minute: 30 */4 * * * runs at 00:30, 04:30 and so on.

Every four hours suits work that should stay fresh during the day without running constantly: refreshing access tokens that expire after a few hours, rolling up metrics into a report, rebuilding a cache or search index, or syncing a product catalog from a supplier.

Which time zone do the six runs follow?

The six slots belong to the scheduler's time zone, and they only line up with your local clock when the offset is a multiple of four hours. A UTC server running 0 */4 * * * fires at 20:00, 00:00, 04:00, 08:00, 12:00 and 16:00 in New York while daylight time (UTC−4) applies, which happens to match New York's own four-hour grid. In winter (UTC−5) the same runs land at 19:00, 23:00, 03:00 and so on, an hour earlier.

If the times matter to people, pin the schedule to their zone: timezone: next to the cron entry on GitHub Actions, spec.timeZone on a Kubernetes CronJob, CRON_TZ in cronie, or EventBridge Scheduler's time zone setting. Cloudflare Workers and Vercel only run in UTC, and on Vercel six runs a day needs a Pro plan, because Hobby projects allow one run a day.

In a local zone with daylight saving time the spacing also changes twice a year. In America/New_York the spring-forward night goes from 00:00 straight to the 04:00 run after only three real hours, and the fall-back night stretches the same gap to five. If an even four-hour rhythm matters more than wall-clock times, schedule in UTC. Need more frequent runs? See every 3 hours or every 2 hours; fewer, see every 6 hours.

What does each field in 0 */4 * * * mean?

FieldValueAllowedMeaning
Minute00–59at minute 0 (on the hour)
Hour*/40–23every 4 hours: 00:00, 04:00, 08:00, 12:00, 16:00 and 20:00
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: At minute 0 of every fourth hour (00:00, 04:00, 08:00, 12:00, 16:00 and 20:00), every day.

How do I adjust 0 */4 * * * to my own schedule?

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

ExpressionWhat it does
0 2-22/4 * * *Every 4 hours starting at 02:00 (02:00, 06:00 … 22:00)
30 */4 * * *Every 4 hours at half past (00:30, 04:30 … 20:30)
0 */4 * * 1-5Every 4 hours on weekdays only
0 8-20/4 * * *Every 4 hours during the day only: 08:00, 12:00, 16:00 and 20:00
0 0,4,8,12,16,20 * * *The same schedule written as an explicit list

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 3 hours · Every 6 hours · Every 2 hours · Every 12 hours

Browse all schedules in the cron schedule library.

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

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

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

0 */4 * * *  /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 */4 * * *?

  • */4 * * * * puts the step in the minute field and runs every 4 minutes. The four-hour version needs a fixed minute first: 0 */4 * * *.
  • 0 2/4 * * * is Quartz and Kubernetes syntax. Linux crontab rejects a step after a single number, so write 0 2-22/4 * * * instead.
  • In a local time zone with daylight saving time, one gap on each change night isn't four real hours: in America/New_York the 00:00 to 04:00 gap is three hours in March and five in November.
  • On Vercel, six runs a day needs a Pro plan; Hobby projects only allow cron jobs that run once a day.
  • In a zone with daylight saving time, a schedule with * in the minute or hour field follows the wall clock: the spring-forward night loses an hour of runs and the fall-back night repeats one. Servers on UTC never see this.

Frequently asked questions

Six times: at 00:00, 04:00, 08:00, 12:00, 16:00 and 20:00 in the scheduler's time zone.
Use 0 2-22/4 * * *, which runs at 02:00, 06:00, 10:00, 14:00, 18:00 and 22:00. Avoid 0 2/4 * * * in Linux crontab, because Vixie cron and cronie reject a step after a single number.
On an ordinary day, yes: 24 divides evenly by 4, so every gap is four hours. On a daylight saving change night in a local time zone one gap is an hour shorter or longer, so schedule in UTC if the exact spacing matters.
Yes. Use 0 */4 * * * under on.schedule. GitHub reads it in UTC unless you add a timezone field with an IANA name such as Europe/Berlin, and scheduled runs can start late when GitHub is busy.

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