How to Read Cron Expressions
A cron expression describes a repeating schedule in a few space-separated fields. The idea is simple, but field order and special characters differ between systems. This guide shows how to read the common formats.
The Five Unix Fields
Classic Unix and Linux cron uses five fields, read from left to right:
minute hour day-of-month month day-of-week
So 30 9 * * 1-5 means "at 09:30, Monday to Friday". Minutes run from 0 to 59, hours
from 0 to 23, days of the month from 1 to 31 and months from 1 to 12. Day of week runs from 0 to 6
with 0 meaning Sunday (many implementations also accept 7 for Sunday). Most versions also accept
names such as JAN or MON, and macros such as @daily or
@hourly.
Spring, Quartz and AWS Formats
Other schedulers add fields, which is the most common source of confusion when copying an expression from one system to another.
| Format | Fields | Day of week |
|---|---|---|
| Unix / Linux | 5: minute hour day month weekday | 0–6, Sunday = 0 |
| Spring | 6: second minute hour day month weekday | 0–7, Sunday = 0 or 7 |
| Quartz | 6 or 7: second minute hour day month weekday [year] | 1–7, Sunday = 1 |
| AWS EventBridge | 6: minute hour day month weekday year | 1–7, Sunday = 1 |
The same digits can mean different things: 0 0 12 * * ? is "every day at noon" in
Quartz, while in a 5-field reading it would not be valid. Day-of-week numbers also shift: in
Quartz and AWS, 2 is Monday, but in Unix cron it is Tuesday. Day names such as
MON avoid this ambiguity where they are supported.
Special Characters
*every value of the field.,a list, e.g.1,15.-a range, e.g.9-17orMON-FRI./a step:*/15in the minute field means every 15 minutes;5/15starts at 5 (not supported by classic Unix cron, where a range such as5-59/15is used).?"no specific value"; Quartz and AWS require it in either day-of-month or day-of-week.Llast:Lin day-of-month is the last day of the month; in Quartz,6Lin day-of-week is the last Friday.Wnearest weekday:15Wis the weekday closest to the 15th.#nth weekday of the month:6#3is the third Friday in Quartz and AWS numbering.
L, W and # are extensions that classic Unix cron does not
support.
Day of Month vs Day of Week
When both day fields are restricted, systems disagree on how to combine them. In classic Unix cron,
the job runs when either field matches: 0 9 13 * 5 runs on the 13th of every
month and on every Friday, not only on Friday the 13th. Spring requires both to match.
Quartz and AWS avoid the question by requiring ? in one of the two fields.
The LeedyBox Cron Parser applies the rule of the format you choose and explains in its summary whether either day or both days must match.
Time Zones and Daylight Saving Time
A cron expression does not include a time zone. It runs in the time zone of the system or service that executes it, which may be the server's local time or UTC. A job written for 09:00 local time can run at a different hour if the server uses UTC.
Daylight saving time adds further edge cases. When clocks go forward, a time such as 02:30 may not exist that day; when they go back, it may occur twice. Depending on the implementation, a job in that window can be skipped, run late or run twice. Scheduling important jobs outside the change window, or in UTC, reduces surprises. The Cron Parser lets you pick a time zone and lists the next run times so you can check dates around a change.
Frequently Asked Questions
How do I run a job every 5 minutes?
In Unix cron, use */5 * * * *. In Spring, add a seconds field at the start:
0 */5 * * * *.
Why does my Quartz expression fail in Linux crontab?
Quartz expressions start with a seconds field and may use ? or L, which crontab does not accept. Rewrite the expression in the 5-field format.
Are the next run times shown by the parser exact?
They are calculated in your browser for the selected format and time zone. Confirm the schedule on the system that will run the job, as implementations can differ.