Cron Every 12 Hours
Run a cron job every 12 hours with 0 */12 * * *. Complete field explanation, practical examples, and tips for twice-daily scheduling.
Cron Expression
0 */12 * * *
Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At 0 |
| Hour | */12 | Every 12th hour |
| Day of Month | * | Every day of the month (1–31) |
| Month | * | Every month (1–12) |
| Day of Week | * | Every day of the week (Sun–Sat) |
Detailed Explanation
The cron expression 0 */12 * * * schedules a task to run once every twelve hours, at the top of every twelfth hour.
Field-by-field breakdown:
0(Minute): At minute 0 only. The task fires at the start of the hour.*/12(Hour): Every 12th hour, starting from hour 0. The step value/12triggers execution at hours 0 and 12.*(Day of Month): Every day from 1 through 31. No restriction on the day of the month.*(Month): Every month from January through December. No restriction on the month.*(Day of Week): Every day of the week from Sunday through Saturday. No restriction on the day.
This means your task will execute twice per day, at midnight and at noon. This is functionally equivalent to the twice-a-day pattern using 0 0,12 * * *. The twelve-hour cadence is ideal for tasks that need to run more than once daily but where higher frequency would be unnecessary. It provides a clear AM/PM split that simplifies monitoring and troubleshooting. This expression is supported by standard cron on Linux/macOS, as well as cloud services like AWS CloudWatch, Google Cloud Scheduler, and GitHub Actions.
Use Case
Useful for syncing a product catalog between your main database and a CDN-backed API, ensuring updates propagate twice daily.
Try It — Interactive Builder
Every 12 hours
Next 10 Executions
Ctrl+Shift+C to copy expression