What a cron expression is
A cron expression is a schedule written as five fields separated by spaces: minute, hour, day of the month, month and day of the week. Each field says which values match — * for any, a number, a list, a range or a step — and the job runs every minute at which all of them match.
| Field | Values | Examples |
|---|---|---|
| Minute | 0–59 | 0, */15, 0,30 |
| Hour | 0–23 | 9, 9-17, */2 |
| Day of month | 1–31 | 1, 1,15, L (Quartz: last day) |
| Month | 1–12 or JAN–DEC | 1, JAN-MAR, */3 |
| Day of week | 0–6 or SUN–SAT (7 is Sunday too) | 1-5, MON,WED, 5#3 (Quartz: third Thursday) |
Cron dialects compared
| Dialect | Fields | Time zone | Differences |
|---|---|---|---|
| Unix cron | 5 | The server's | @daily and friends; day of month or day of week when both are set. |
| GitHub Actions | 5 | Always UTC | No @ macros; at most every 5 minutes; runs can start late under load. |
| Kubernetes CronJob | 5 | spec.timeZone, else the controller's | Macros except @reboot; no TZ= inside the schedule. |
| Quartz (Java, Spring) | 6–7, seconds first | The scheduler's | ? in day of month or week; L, W, #; Sunday is 1, not 0. |
Common schedules
Four cron gotchas
- Day of month OR day of week
0 9 1 * 1runs on the 1st and on every Monday, not on Mondays that fall on the 1st. - Months without the day
0 0 31 * *runs in only seven months. Quartz'sLmeans "last day". - Whose 09:00?A schedule runs on the server's clock — UTC on most cloud machines, and always UTC on GitHub Actions.
- Daylight saving timeA job at 02:30 in a zone that skips 02:00–03:00 runs zero times that day, and one at 01:30 runs twice in autumn.
How to use the cron explainer
- Pick the Dialect your schedule runs in.
- Paste or type the expression — or click one of the common schedules above.
- Read the sentence and each field's meaning, and check the warnings.
- Check the Next 10 runs, shown in the time zone you choose and in UTC.
- Or build one with Build an Expression, then copy the crontab line, workflow or CronJob snippet.
Frequently asked questions
Why did my job run on the wrong day?
When both the day of month and the day of week are restricted, Unix cron runs on days that match either. 0 9 1-7 * 1 runs on the first seven days of the month and on every Monday. To get "the first Monday", restrict one field and check the other inside the script, or use Quartz's 1#1.
Why does my GitHub Actions schedule run late?
GitHub queues scheduled workflows and can delay them during busy periods, especially at the start of every hour. Schedules are always in UTC, and anything more frequent than every 5 minutes is not supported. Pick an odd minute such as 17 instead of 0.
Which time zone does my cron use?
Unix cron uses the server's zone. GitHub Actions always uses UTC. A Kubernetes CronJob uses spec.timeZone if you set it, otherwise the controller manager's zone — set it explicitly. Quartz uses the scheduler's zone unless the trigger names one.
Why did a job run twice, or not at all, around a clock change?
A time that is skipped when clocks go forward never matches, and a time that repeats when they go back matches twice — that is what the next runs above show. Some daemons compensate: Vixie cron and cronie run a skipped fixed-time job right after the change and do not repeat one in the doubled hour.
What are the six- and seven-field expressions I see in Java?
That is Quartz, used by Spring's @Scheduled and many Java schedulers: seconds come first, an optional year comes last, and one of the two day fields must be ?. Choose the Quartz dialect to read them.