Skip to content

Cron Every 2 Hours

Every 2 hours is 0 */2 * * *: minute 0 of hours 0, 2, 4 and so on to 22, twelve times a day.

minute · hour · day · month · weekday

Build it with controlsEvery 2 h at :00
Every … hours
Between
On

In plain English

Every 2 hours on the hour, from 12:00 AM to 10:00 PM.

Tap a field to see what it means.

A week84 runs
Mon12Tue12Wed12Thu12Fri12Sat12Sun12
Next run
—
Usually every
—
Time zone
Yours
Convert to another schedulerQuartz, Spring, AWS, GitHub Actions, Kubernetes
The same schedule in every dialect
Standard cron0 */2 * * *current
Quartz0 0 0/2 * * ?
Spring0 0 */2 * * *
AWS EventBridgecron(0 0/2 * * ? *)
GitHub Actions0 */2 * * *
Kubernetes0 */2 * * *
About Standard cronTime zone, day numbering, daylight saving
  • Runs in the machine’s local time zone; cronie also reads CRON_TZ at the top of the crontab.
  • Five fields, then the command. Day of week is 0–7 (0 and 7 are Sunday) or SUN–SAT; months 1–12 or JAN–DEC.
  • When both day fields are set, a day that matches either one runs.
  • Daylight saving: a job at a fixed time in a skipped hour runs right after the change, and one in a repeated hour runs once. Jobs with * in the minute or hour follow the clock.

Sources: crontab(5), cronie, cron(8), cronie, POSIX crontab.

How this works: Method, 10 sources, Checked against 1 worked example,

How this works

Method

The expression is read field by field with the rules of the scheduler you pick (ranges, lists, steps, names, @ macros, and L, W and # where it has them) into the values each field allows. The next runs come from stepping forward through the calendar in the chosen time zone, day by day and then time by time, using that scheduler’s rule for when both day fields are set and its documented rule for daylight saving (where it has none, a skipped time is skipped and a repeated one runs once). A conversion to another scheduler is parsed back and checked against the original before it is shown.

How it’s tested

One worked example for this page is checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Changes

  • First version: plain English and the next runs for six schedulers, a builder, conversion between them, and 20 pages for common schedules.

How we make toolsReport a mistake

Worked example: 0 */2 * * *

Say the clock reads Monday 4 January 2027, 11:30 AM UTC. 0 */2 * * * means “every 2 hours on the hour, from 12:00 AM to 10:00 PM”, so the next five runs are Monday 4 January 2027, 12:00 PM, 2:00 PM, 4:00 PM, 6:00 PM and 8:00 PM.

In UTC, where no clock change interrupts it, that comes to 12 runs a day, 84 a week and 4,380 in 2027.

Every other hour

0 */2 * * * has two parts that matter: */2 in the hour field picks hours 0, 2, 4 … 22, and the 0 in the minute field picks one minute of each. Together they run at 12:00 AM, 2:00 AM and every even hour after, twelve times a day.

For the odd hours, give the step a start: 0 1-23/2 * * * runs at 1:00, 3:00 … 23:00. Both forms restart at midnight, so 24 must divide by the step for the gap across midnight to match the others.

A step such as */5 in the hour field doesn’t divide 24: it runs at 0, 5, 10, 15 and 20, and then again at midnight, only four hours after 20:00.

Pitfalls

  • * */2 * * * runs every minute of every second hour: 60 runs an hour, not one.
  • Every 2 hours from a time other than midnight (say from 9:00) is a range: 0 9-23/2 * * * runs at 9, 11 … 23, and starts again at 9 the next day.
  • Steps restart each day, so cron can’t do “every 2 hours from now” exactly; for a strict interval use a timer that counts elapsed time.
  • “0-23/2” in the hour field runs the command every other hour; the V7 alternative is the list 0,2,4,6,8,10,12,14,16,18,20,22. Source: crontab(5), cronie.
  • Kubernetes: */2 in the hour field means every two hours, as in Vixie cron. Source: Kubernetes: CronJob.

“Every 2 Hours” in every scheduler

The same schedule written for each scheduler, converted and checked by this tool. A dash means that scheduler can’t express it in one expression; the note says why.

The same schedule written for each scheduler, converted and checked by this tool. A dash means that scheduler can’t express it in one expression; the note says why.
SchedulerExpressionNote
Standard Unix cron (Vixie cron, cronie)0 */2 * * *
Quartz Scheduler (Java)0 0 0/2 * * ?
Spring Framework @Scheduled0 0 */2 * * *
Amazon EventBridge cron()cron(0 0/2 * * ? *)
GitHub Actions schedule0 */2 * * *
Kubernetes CronJob0 */2 * * *

Frequently Asked Questions

Why does 0 */2 * * * start at midnight?

A step counts from the first value of the field, and the hour field starts at 0. So */2 means hours 0, 2, 4 and so on, whatever time you installed the job.

How do I run every 2 hours on odd hours?

Start the range at 1: 0 1-23/2 * * * runs at 1:00, 3:00, 5:00 … 23:00.

What is every 2 hours in Quartz and Spring?

Quartz: 0 0 0/2 * * ?. Spring: 0 0 */2 * * *. Both add a seconds field in front and keep minute 0.