JustConvertAll-in-One Convert
Dev

How Cron Expressions Work: A Field-by-Field Guide

Cron expressions schedule recurring jobs with five fields and a handful of operators. Learn each field, the special characters, common gotchas like the day-of-month/day-of-week OR rule, and how to read any schedule at a glance.

June 15, 2026·7 min read

Cron is the time-based job scheduler that has driven recurring tasks on Unix systems for decades, and its expression syntax has been adopted far beyond cron itself — by Kubernetes CronJobs, CI pipelines, cloud schedulers, and countless application frameworks. A cron expression is a compact string that answers one question: at which minutes should this job run?

The Five Fields

A standard cron expression has five space-separated fields, read left to right: minute, hour, day-of-month, month, and day-of-week. Each field accepts a value within its own range. A job runs when the current time matches all of the specified fields.

┌───────────── minute        (0–59)
│ ┌─────────── hour          (0–23)
│ │ ┌───────── day of month  (1–31)
│ │ │ ┌─────── month         (1–12)
│ │ │ │ ┌───── day of week    (0–6, Sunday = 0)
│ │ │ │ │
* * * * *

The Operators

  • Asterisk (*) — every value of the field. * in the hour field means every hour.
  • Comma (,) — a list of values. 1,15,30 in the minute field means at minute 1, 15, and 30.
  • Hyphen (-) — an inclusive range. 9-17 in the hour field means every hour from 9 AM to 5 PM.
  • Slash (/) — a step. */15 in the minute field means every 15 minutes; 0-30/10 means minutes 0, 10, 20, 30.

Reading Examples

0 * * * *      → every hour, on the hour
*/15 * * * *   → every 15 minutes
0 9 * * 1-5    → 9:00 AM, Monday through Friday
30 2 1 * *     → 2:30 AM on the 1st of every month
0 0 * * 0      → midnight every Sunday

The Day-of-Month / Day-of-Week Gotcha

The single most misunderstood rule in cron: when both the day-of-month and day-of-week fields are restricted (neither is *), they are combined with OR, not AND. The expression 0 0 1 * 1 does NOT mean 'midnight on the first of the month only if it is a Monday' — it means 'midnight on the 1st of the month OR any Monday.' If you need an AND condition, restrict only one of the two fields and check the other inside your job, or use a scheduler that supports AND semantics.

Time Zones and Non-Standard Extensions

Traditional cron runs in the server's local time zone, which means daylight-saving transitions can cause a job to be skipped or run twice. Modern schedulers let you pin a time zone explicitly. Many implementations also add extensions: a sixth field for seconds, named shortcuts like @daily and @hourly, and special characters such as L (last day), W (nearest weekday), and # (the Nth weekday of the month). These are convenient but not portable, so verify support before relying on them.

When in doubt, translate the expression into plain English and compute the next several run times before deploying. A schedule that looks right can hide the day-of-month/day-of-week OR trap or an unintended every-minute run.

Try the tools