Cron expression for twice a day

Runs the job at midnight and at noon.

0 0,12 * * *

Generator

At 12:00 AM and 12:00 PM

Field by field

  • Minute · 0–59 0 only at minute 0
  • Hour · 0–23 0,12 only at 00:00 and 12:00
  • Day of month · 1–31 * every day of the month
  • Month · 1–12 or JAN–DEC * every month
  • Day of week · 0–7 or SUN–SAT * every day of the week

Next runs in your local time

Why this schedule, and when it bites

Twice a day is a business requirement, not a timer: one run for the night shift, one for the day shift; one refresh before each peak. 0 0,12 * * * names the two hours as a list, which is the property that matters: the list is read literally, and nobody has to remember which step length happens to land on the same numbers today.

A step that means the same thing today. 0 */12 fires at 00:00 and 12:00 exactly like the list. The difference appears the day someone edits */12 to */8 and the twice-daily job becomes three runs. A list states the two hours and cannot drift.

Noon is the busiest minute of the second half. Both runs land on the shared minute 0. If the job is heavy, give it a few past the hour, for example 0 1,13 * * *, and it keeps the shape while avoiding the midday crowd.

Midnight belongs to the previous day. The 00:00 run is the start of a new date; a job that wants yesterday's data has to read yesterday explicitly, not 24 hours ago. The server timezone decides when that boundary lands for the business.

Where this cron expression shows up

  • One report for each shift, instead of one nobody reads at 3 AM
  • Syncing with a partner system that opens twice a day
  • Warming the cache before the morning and the afternoon peaks

Common variations

0,12 is a list of two hours, so the runs are exactly midnight and noon. 0 */12 fires at the same two times today and drifts the moment anybody edits the step, which is how a "twice a day" job quietly becomes four.

Ranges, steps, and names are spelled out on the cheat sheet.

Questions this schedule raises

Does 0 0,12 * * * mean every twelve hours?

It fires at the same two clock times, but the list is explicit: midnight and noon. Steps read the field from zero and happen to match today; the list keeps the meaning when edits come.

How do I make it 8 AM and 8 PM?

0 8,20 * * *. The list replaces the hours; the minute stays 0. That gives two runs tied to the working day, with a twelve-hour gap between them.