DevToolBayFree Developer Tools

Cron Expressions: A Field-by-Field Guide with Real Examples

Read and write cron like a native: what the 5 fields mean, steps and ranges, the day-of-month vs day-of-week rule, @daily shorthands and timezone pitfalls.

Cron is still the scheduling language of servers, CI pipelines and Kubernetes CronJobs — and still the source of countless why did it run at midnight? moments. The syntax fits in one screen once the fields click.

The five fields, left to right

  • minute 0-59
  • hour 0-23
  • day of month 1-31
  • month 1-12
  • day of week 0-7 (0 and 7 are both Sunday)

An asterisk means every value, a list picks several, a range spans, and a step (*/5) filters. So */15 9-17 * * 1-5 reads: every 15 minutes, from 9 to 17, every day, every month, Monday to Friday.

The one rule that trips everyone

When both day-of-month and day-of-week are restricted, standard Vixie cron runs the job on days matching either — not both. That surprise is behind most phantom schedules. Verify any expression in the Cron Expression Parser, which explains the rule and previews upcoming run times.

Shorthands and modern dialects

  • @hourly, @daily, @weekly, @monthly, @yearly — readable equivalents of common patterns.
  • Quartz uses 6 fields (adds seconds) and different day names — a frequent porting bug.

Time zones: the silent schedule killer

Cron evaluates in the server time zone. A container running UTC shifts every 0 9 * * * job by hours versus your wall clock. When coordinating schedules across systems, convert the run times with the Unix Timestamp Converter and log the actual epoch of each execution.

Before pasting into crontab, a quick pass through the parser catches reversed fields, off-by-one day names and impossible dates like February 30.

Related guides

Try these tools