Cron Expression for Twice a Day

Twice a day, twice a day
0 0,12 * * *

Cron reads this as: minute 0, past hour 0 and 12.

Next 5 runs

These times are in your browser's local time zone. Cron itself uses the server's zone, which on most cloud hosts is UTC. If the difference matters here, see time zones & DST.

When to use this schedule

A comma-separated list in the hour field gives you two fixed times, in this case midnight and noon. Unlike */12, a list lets you pick times that are not evenly spaced, which is usually what "twice a day" means in practice. For runs at the start and end of the working day you might use 0 8,17 * * *.

What to watch out for

If the two runs do different work, write two crontab lines instead of making one expression serve both. A single job that branches on date +%H is harder to test and to run by hand, and you cannot reschedule one run without the other. Two lines with two log files cost nothing and are much easier to reason about at 3 AM.

The crontab line

0 0,12 * * * /usr/local/bin/your-job.sh >> /var/log/your-job.log 2>&1

Send the output to a log you will read. By default cron mails it, and on a host with no mail transport that mail is silently dropped. See the crontab guide for the surrounding syntax.

Related schedules

Variations on twice a day
ExpressionSchedule
0 */12 * * *Same times, written as a step
0 6,18 * * *Morning and evening
0 9,17 * * 1-5Start and end of the workday

Build your own

If this page doesn't cover the schedule you need, compose it field by field in the visual builder, or paste an expression you already have into the explainer for a per-field breakdown. The examples library has sixty schedules in one place, and the guides cover crontab syntax, time zones, troubleshooting and production practices.