Skip to content

Cron expression cheat sheet (5 fields)

A cron expression is a compact schedule string used by Unix cron and many CI/job runners.TryDevSnip is a free developer toolkit in the Try family by Samson PG. TheCron Helper explains expressions and previews next runs in your browser — nothing is uploaded.

Field order

Left to right for classic five-field cron:

PositionFieldAllowed valuesNotes
1Minute0–59First field
2Hour0–2324-hour clock
3Day of month1–31dom
4Month1–12Or JAN–DEC on some crons
5Day of week0–7 or SUN–SATNumbering varies by system

Special characters

CharMeaningExample
*Any value* in hour = every hour
,List1,15 in minute = at :01 and :15
-Range9-17 in hour = 9 through 17
/Step*/5 in minute = every 5 minutes

Common presets

GoalExpressionPlain English
Every minute* * * * *Fires every minute
Every 5 minutes*/5 * * * *:00, :05, :10, …
Hourly0 * * * *At minute 0 of every hour
Daily midnight0 0 * * *00:00 every day (scheduler TZ)
Weekdays 9am0 9 * * 1-5Mon–Fri at 09:00 (dow numbering varies)
Monthly 1st0 0 1 * *Midnight on day 1 of each month

Timezone trap

Cron usually runs in the scheduler’s timezone (often UTC on cloud hosts), not the timezone shown on your laptop. “Midnight” on the host may be afternoon where you live. Confirm TZ in the platform docs, or convert wall-clock times with theTimestamp Converter before you ship the expression.

Try tools & guides on TryDevSnip

Frequently asked questions

Is cron 5 fields or 6 fields?

Classic Unix cron uses five fields: minute, hour, day-of-month, month, day-of-week. Some systems (Quartz, Spring, Kubernetes CronJob with seconds) add a leading seconds field — that is six (or more) fields. If an expression “looks right” but never fires, count the fields and check your scheduler’s docs.

Does @hourly work everywhere?

No. Nicknames like @hourly, @daily, and @weekly are Vixie/cronie conveniences. Many managed schedulers and libraries only accept numeric five-field expressions. Prefer 0 * * * * for “every hour at minute 0” when you need portability.

Is day-of-week 0 Sunday or Monday?

It depends on the implementation. In many Unix crons, 0 and 7 are Sunday and 1 is Monday. Others document Monday as 1 with Sunday as 7 only. Always confirm numbering (and whether both day-of-month and day-of-week can be set together) for your scheduler.

Why did my cron fire at the wrong local time?

Most servers evaluate cron in the scheduler’s timezone (often UTC), not your laptop’s clock. A “9am weekdays” expression on a UTC host is 9:00 UTC. Convert with a timestamp tool, or set the job’s TZ explicitly if the platform supports it.