Cron expression for twice a day
0 0,12 * * * runs at 00:00 and 12:00 every day. A comma-separated list in the hour field is all it takes.
This tool runs in your browser. We never send what you type or paste to a server.
The expression
0 0,12 * * * /path/to/commandThe expression has five fields, read left to right:
| Field | Value | Meaning here |
|---|---|---|
| Minute | 0 | at minute 0 |
| Hour | 0,12 | at hours 0 and 12 |
| Day of month | * | every day of the month |
| Month | * | every month |
| Day of week | * | every day of the week |
When it runs
Starting from Wed 2027-01-06 10:07 UTC, the next runs are:
Wed 2027-01-06 12:00
Thu 2027-01-07 00:00
Thu 2027-01-07 12:00
Fri 2027-01-08 00:00
Fri 2027-01-08 12:00
Sat 2027-01-09 00:00Cron uses the time zone of the machine or service that runs it. The explainer at the top of this page shows the next runs in your own time zone.
Other pairs of times
0 0,12 * * * 00:00 and 12:00
0 */12 * * * the same thing, written as a step
0 8,20 * * * 08:00 and 20:00
30 6,18 * * * 06:30 and 18:30
0 9,17 * * 1-5 09:00 and 17:00 on weekdaysLists can be as long as you like: 0 6,12,18 * * * is three times a day.
When one line is not enough
Every hour in the list is combined with every minute in the minute field. That works when both runs share the same minute. For 08:30 and 17:00 it does not: 0,30 8,17 * * * would run at 08:00, 08:30, 17:00 and 17:30. Use two lines instead:
30 8 * * * /path/to/command
0 17 * * * /path/to/commandIn GitHub Actions, add two - cron: entries under schedule. In Kubernetes you need two CronJob objects, because each takes a single schedule.
Quartz adds a seconds field at the front, AWS adds a year at the end, and both need ? in one of the two day fields. See how the syntaxes differ.
The same schedule in other schedulers
| Scheduler | Expression |
|---|---|
| Unix cron, crontab | 0 0,12 * * * |
| Kubernetes CronJob | schedule: "0 0,12 * * *" |
| GitHub Actions | - cron: '0 0,12 * * *' |
| Quartz (Java, Spring) | 0 0 0,12 * * ? |
| AWS EventBridge | cron(0 0,12 * * ? *) |
Questions
How do I schedule a cron job twice a day?
List both hours in the hour field: 0 0,12 * * * runs at midnight and noon; 0 8,20 * * * at 8am and 8pm.
How do I run a cron job at two different times with different minutes?
Use two crontab lines, one for each time. A single expression combines every listed minute with every listed hour, which would give four runs.