A cron expression is five short fields that describe when a job should run. It looks cryptic for about ten minutes, then becomes second nature — until a job fires at the wrong hour after a daylight saving change, or a */5 schedule runs more often than expected.
This guide covers the field order, the characters that matter, the expressions you will actually write, and the traps worth knowing before the job runs in production.
The five fields
┌───────── minute 0–59
│ ┌─────── hour 0–23
│ │ ┌───── day of month 1–31
│ │ │ ┌─── month 1–12
│ │ │ │ ┌─ day of week 0–7 (0 and 7 are Sunday)
│ │ │ │ │
* * * * *
The order is minute, hour, day of month, month, day of week. Most bugs come from reading it as day, month, year, which it is not.
Cron runs in the time zone of the machine or the scheduler, not in the user’s time zone. If the server is on UTC and you expect a 9:00 local job, you need to convert.
The characters that matter
| Character | Meaning | Example |
|---|---|---|
* | Every value | * * * * * runs every minute |
, | A list | 0 9,17 * * * at 09:00 and 17:00 |
- | A range | 0 9-17 * * * hourly from 09:00 to 17:00 |
/ | A step | */15 * * * * every 15 minutes |
? | Any value (Quartz) | Used where day-of-month or day-of-week is unspecified |
Ranges are inclusive. 0-5 in the minute field means minutes 0, 1, 2, 3, 4 and 5.
Schedules people actually need
| Goal | Expression |
|---|---|
| Every minute | * * * * * |
| Every 5 minutes | */5 * * * * |
| Every 15 minutes | */15 * * * * |
| Every hour, on the hour | 0 * * * * |
| Every day at midnight | 0 0 * * * |
| Every day at 09:00 | 0 9 * * * |
| Weekdays at 09:00 | 0 9 * * 1-5 |
| Monday at 08:30 | 30 8 * * 1 |
| First day of the month | 0 0 1 * * |
| Every Sunday at 03:00 | 0 3 * * 0 |
| Every 6 hours | 0 */6 * * * |
A detail worth noticing: */5 in the minute field means minutes 0, 5, 10, and so on. It does not mean “five minutes after the last run”. If a job takes seven minutes, the next run still starts at the next multiple of five, so runs can overlap. Many schedulers allow only one instance at a time; check yours before assuming.
Day-of-month and day-of-week together
In classic cron, when both day-of-month and day-of-week are restricted, the job runs if either matches. So this expression:
0 0 1 * 1
runs on the first of the month and every Monday, not only on Mondays that happen to be the first. Most people expect an intersection, and most people are surprised.
If you need “first Monday of the month”, cron cannot express it directly. Run daily and check the date in the job, or use a scheduler with calendar support.
Five fields vs six
Cron has dialects:
- Classic cron (Vixie cron, crontab, most Linux schedulers): five fields, no seconds.
- Quartz (Java): six or seven fields, with seconds first.
- AWS EventBridge, some CI systems: different presets and extensions such as
@daily,@weekly,@monthly. - Kubernetes CronJob: five fields, plus
.spec.timeZonein recent versions.
0 0 * * * is midnight in classic cron. In a Quartz six-field schedule, 0 0 0 * * ? is midnight — a five-field expression pasted into a six-field scheduler runs at the wrong time, often at the top of every hour. Always confirm the field count before copying an expression.
The daylight saving trap
Cron uses wall-clock time. When clocks move forward, an hour disappears; when they move back, an hour repeats.
- A job scheduled at 02:30 may not run on the day the clock jumps from 02:00 to 03:00.
- A job scheduled at 01:30 may run twice on the day the clock falls back.
Some schedulers handle this by skipping, some by running once, some by running twice. The behavior is implementation-specific, so do not assume. For jobs that must run exactly once per day, schedule outside the 01:00–03:00 local window, or run in UTC and store the intended local time separately.
Common mistakes
- Confusing the field order. Day of month comes before month, not after.
- Using
*in day-of-month and day-of-week together and expecting an intersection. - Assuming
*/5means “every five minutes since the job started”. It means clock-aligned steps. - Forgetting the time zone of the scheduler.
- Expecting seconds in a five-field expression.
- Scheduling at the same minute as every other job, creating a load spike at
0 * * * *. - Not checking that the job finished before the next run starts.
Testing a schedule
Before deploying, translate the expression into plain language and compare it with what you intended. Then check:
- the next five run times;
- the behavior across a DST boundary;
- the field count expected by your scheduler;
- whether overlapping runs are allowed.
The Cron Expression Generator builds an expression from plain choices and shows the next run times, so you can verify the schedule without counting fields by hand. If you need to confirm what a specific run time means in another zone, the Timestamp Converter turns it into an exact UTC instant.
A short checklist
- Confirm the dialect: five fields or six.
- Write the schedule as a sentence first: “weekdays at 09:00 in UTC”.
- Avoid the 01:00–03:00 local window for once-a-day jobs.
- Expect either-match when both day fields are restricted.
- Keep a unique minute per job to avoid load spikes.
- Log the actual start time and duration of every run.
Cron is old, small and still everywhere. Most incidents are not caused by the syntax but by the assumptions around it: which time zone, which field order, and what happens when the clocks change.