Skip to content
Unix cron100% Client-Side

Cron Expression for Every 2 Hours Between 9 AM and 6 PM

0 9-18/2 * * *On the hour, every 2 hours, between 09:00 AM and 06:00 PM

The Unix cron expression "0 9-18/2 * * *" runs a task every 2 hours between 9 am and 6 pm. 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
  • Hour9-18/2
  • DOM*
  • Month*
  • DOW*

On the hour, every 2 hours, between 09:00 AM and 06:00 PM

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 9-18/2 * * * is interpreted in the Unix cron format.

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

Running “0 9-18/2 * * *” in production

The step-in-range trap: why 9-18/2 never fires at 6 PM

0 9-18/2 * * * reads as 'every two hours from 9 AM to 6 PM' and computes something subtly different: a step applied to a range anchors at the range start and advances by the step while inside the range — 9, 11, 13, 15, 17 — and stops there. 18 is not a member (9 + 2×5 = 19 exceeds 18), so the last fire of the day is 5 PM and 6 PM passes in silence despite the prose. Five fires per day, not six. This is the single most-cited surprise in the range-with-step grammar, and the reason schedules like this deserve a simulator pass before review sign-off.

The fix depends on intent. If the interval should end by 6 PM, 9-18/2 is already correct and the prose should say 'every two hours from 9 AM until 6 PM, last fire 5 PM'. If an 18:00 fire is genuinely required, no range-step form produces it — the span 9→18 is nine hours and indivisible by two — so the honest expression is the explicit list 0 9,11,13,15,17,18 * * * or a second line for the evening fire. Lists are not a failure of elegance; they are what cron offers when the arithmetic refuses to cooperate.

Choosing the cadence: what five fires a day is for

The every-two-hours-within-office-hours shape sits between the hourly office schedule (nine fires) and the twice-daily bookends (two fires): frequent enough that a queue, feed, or dashboard is never more than two hours stale while staffed, sparse enough that each run can afford real work — a 15-minute report build, a full reconciliation pass, an API sync with pagination. Typical tenants: twice-per-shift sync jobs in factories and support desks, midday price or inventory refreshes in retail, and internal data pipelines that feed tools checked 'a few times a day'.

The overnight silence carries the same duty as every windowed schedule: the 17:00 fire and the next morning's 09:00 fire bracket sixteen hours of accumulation, so watermark-based processing and bounded backlog handling are mandatory, not optional. And because the day field is still *, the schedule runs weekends as written — pair it with 1-5 (0 9-18/2 * * 1-5) when the office calendar governs. The next-run table above enumerates the five daily fires and the gap to the following morning's first, which is the exact number your backlog logic must tolerate.

Frequently asked questions

What does the cron expression "0 9-18/2 * * *" mean?

"0 9-18/2 * * *" is a Unix cron expression that means: On the hour, every 2 hours, between 09:00 AM and 06:00 PM. It contains 5 fields — Minute (0), Hour (9-18/2), Day of Month (*), Month (*), Day of Week (*) — and works in any scheduler that accepts the Unix cron format.

How does "0 9-18/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.

How do I test "0 9-18/2 * * *" on a Linux server?

Add it with crontab -e, save, and watch the log: /var/log/syslog on Debian/Ubuntu or /var/log/cron on RHEL-family systems shows every firing. For a dry run without touching your crontab, use the simulator at the top of this page — it computes the next runs locally in your browser.

Why doesn't 0 9-18/2 fire at 6 PM (18:00)?

Because a step inside a range starts at the range's first value and advances by the step: 9, 11, 13, 15, 17 — and 19 would fall outside 9-18, so the sequence stops at 17. The 6 PM endpoint named in prose is a boundary of the range, not a member of the arithmetic sequence. To include an 18:00 fire, write the explicit list 9,11,13,15,17,18 or reframe the schedule as 9-18/2 with a documented 5 PM last fire.

How many times per day does 0 9-18/2 run?

Five: 09:00, 11:00, 13:00, 15:00, and 17:00. The intuitive 'six' comes from counting the endpoints (9, 11, 13, 15, 17, 18) as if the step sampled them evenly, but the step form generates members arithmetically from the anchor rather than sampling boundaries. 35 fires per week on the unrestricted daily form, 25 when paired with a Monday-Friday day range.

About the “0 9-18/2 * * *” schedule

0 9-18/2 * * * is the Unix cron way to say “On the hour, every 2 hours, between 09:00 AM and 06:00 PM”. 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.