How to read and test a cron expression
- Type or paste an expression into Cron expression, or press a preset. The weekday schedule
0 9 * * 1-5is loaded for you, and the result updates as you type. - Read the Plain-English schedule, then check the Field breakdown, which explains each field on its own.
- Open Time zone for the run times and choose the zone your scheduler uses, often UTC. Set Start from to list the runs after a date and time you care about, such as a daylight saving change.
- No expression yet? Pick a value for each field in Build an expression and press Use expression.
How it works
A cron expression has five fields: minute, hour, day of month, month and day of week. Each accepts a number, a range (9-17), a list (1,15), a step (*/10) or * for every value. Month and weekday names such as JAN and MON work, and Sunday is 0 or 7. A leading seconds field (six fields, as in Spring) is also accepted.
The rules follow the behavior described in the crontab(5) manual page and the cronie source. The one that surprises people is the day rule: if both day of month and day of week are restricted, a run happens when either one matches. If either of those fields starts with an asterisk, such as */2, both must match. Next runs are found by checking each calendar day in the chosen time zone.
Worked example
For 0 9 * * 1-5 the schedule reads "At 09:00, on Monday through Friday". The breakdown shows Minute 0 as "At minute 0", Hour 9 as "At 9 AM", Day of month * as "Every day of the month", Month * as "Every month" and Day of week 1-5 as "Monday through Friday". The run list starts with the next weekday at 09:00, then each weekday after it, and skips Saturdays and Sundays.
Limits and edge cases
- Clocks that jump forward have no 02:30, so a daily 02:30 job is skipped that day, as crontab(5) says. When clocks go back, a time can occur twice and the list flags it.
- Quartz extras (
L,W,#) and a trailing year are rejected with a message.?is accepted in the two day fields. - A schedule such as
0 0 31 4 *never runs, because April has 30 days, and the tool says so.0 0 29 2 *lists only leap years. - A weekday range cannot wrap, so write
SAT,SUNinstead ofSAT-SUN. - The tool looks 60 years ahead and shows at most 10 runs. Other schedulers, such as Quartz, number weekdays differently, so check their documentation.
Frequently asked questions
What does */5 * * * * mean?
It runs every 5 minutes, at minutes 0, 5, 10 and so on up to 55 of every hour, every day.
How do I run a cron job every weekday at 9 AM?
Use 0 9 * * 1-5. The 0 is the minute, 9 is the hour, and 1-5 means Monday through Friday.
Why does my job run on the 15th and on every Friday?
In an expression like 0 0 15 * 5 both day fields are restricted, so cron runs the job when either one matches. To get only Fridays that fall on the 15th, run daily and test the date inside the script.
What time zone does cron use?
The time zone of the machine or service that runs it, which is often UTC on servers and in cloud schedulers. Choose that zone in the tool to see the right run times.
What is the difference between 5-field and 6-field cron?
Standard Unix cron has five fields. Some schedulers, such as Spring, add a seconds field at the front. This tool treats six fields as seconds first.
Next steps: convert a run time between zones with the time zone converter, turn a Unix time into a date with the timestamp converter, or check local times around the world with the world clock. For more examples, read Cron Expressions Explained.