How to Build a Cron Expression: Minute, Hour, Day
Last updated: · 2 min read
Scheduled jobs use cron expressions, and the field order is easy to mix up. The tool asks for frequency, time and days, writes the expression, explains it and lists the next runs. This guide explains the formula, works through an example and lists the usual mistakes.
Formula
minute hour day-of-month month day-of-week * any · */n every n · a-b range · a,b list
Sunday is 0 or 7. If both day fields are set, most systems run when either matches.
What the inputs mean
- Frequency
- Minutely to yearly.
- Time
- When it runs.
- Days
- Weekday or day of month.
Worked example: Weekdays at 09:00
- Choose weekdays, hour 9, minute 0.
- Expression: 0 9 * * 1-5.
- The next runs are listed.
Result: The job runs Monday to Friday at 09:00.
How to read the result
Check the server's time zone; many servers use UTC.
Common mistakes
- Forgetting the time zone.
- Choosing the 31st in months without it.
- Setting both day fields.
Frequently asked questions
Is there a seconds field?
Not in classic cron; some systems add one.
What is @daily?
A shortcut for 0 0 * * *.
Why is */7 uneven?
It restarts each hour.
The result is not exact or binding and is for information only; it is not an official document and cannot be used in official procedures. Confirm it with the competent authority or a professional before acting; no liability is accepted for losses arising from its use.