Cron expression for every 2 hours

0 */2 * * *

Every 2 hours, on the hour.

0 */2 * * * fires at minute 0 of hours 0, 2, 4 … 22: twelve runs a day. Leaving the minute as * would run every minute of those hours.

Try it and tweak it

Change any field below and the preview updates. Set the time zone to match your server.

✓ Valid cron

Every 2 hours, on the hour.

Next 10 runs

Calculating in your browser…

Times are computed in your browser for the selected zone and are informational. The server that runs the job uses its own zone (often UTC) and cron flavour, so verify there.

Same schedule in other dialects

Unix crontab0 */2 * * *
Quartz0 0 */2 * * ?
Spring @Scheduled0 0 */2 * * ?
AWS EventBridgecron(0 */2 * * ? *)

Variations

0 1-23/2 * * *Every 2 hours on odd hours
30 */2 * * *Every 2 hours at half past

In other schedulers

crontab line0 */2 * * * /path/to/command
Quartz0 0 */2 * * ?
Spring@Scheduled(cron = "0 0 */2 * * ?")
AWS EventBridgecron(0 */2 * * ? *)
GitHub Actions- cron: '0 */2 * * *' (UTC)
Kubernetesschedule: "0 */2 * * *"

Questions

What is the cron expression for every 2 hours?
0 */2 * * *. Every 2 hours, on the hour.
How do I write it in Quartz or Spring?
Add a seconds field and use "?" for the unused day field: 0 0 */2 * * ?. In Spring: @Scheduled(cron = "0 0 */2 * * ?").
What is the AWS EventBridge version?
cron(0 */2 * * ? *). AWS uses six fields with a year at the end and needs "?" in one of the day fields.
Which time zone will it use?
The time zone of the machine or service running cron. GitHub Actions and Vercel use UTC; Kubernetes uses spec.timeZone if set. The preview above lets you pick a zone.