- ,Ranges (-) and lists (,) in cron expressions
A hyphen makes an inclusive range and a comma separates values. You can combine them in one field, such as 1-5,10.
The rules
- 9-17 in hours: 9, 10, ... 17 (both ends included).
- 1,15 in day-of-month: the 1st and the 15th.
- Lists can mix ranges and single values: 1-3,7.
- Ranges can take steps: 0-30/10.
Examples you can copy
0 9-17 * * 1-5At minute 0, during hours 09, 10, 11, 12, 13, 14, 15, 16, 17, on Mon, Tue, Wed, Thu and Fri. Every hour from 9 to 17 on weekdays.
First runs after 1 Jan 2027 (UTC): Fri, 01 Jan 2027, 09:00 ยท Fri, 01 Jan 2027, 10:00 ยท Fri, 01 Jan 2027, 11:00
0 0 1,15 * *At 00:00 UTC, on the 1st and 15th of the month. The 1st and the 15th at midnight.
First runs after 1 Jan 2027 (UTC): Fri, 15 Jan 2027, 00:00 ยท Mon, 01 Feb 2027, 00:00 ยท Mon, 15 Feb 2027, 00:00
0 8,12,18 * * *At minute 0, during hours 08, 12, 18. Three times a day.
First runs after 1 Jan 2027 (UTC): Fri, 01 Jan 2027, 08:00 ยท Fri, 01 Jan 2027, 12:00 ยท Fri, 01 Jan 2027, 18:00
0 0 9 ? * MON-WED,FRIAt 09:00 UTC, on Mon, Tue, Wed and Fri. Monday to Wednesday and Friday.
First runs after 1 Jan 2027 (UTC): Fri, 01 Jan 2027, 09:00 ยท Mon, 04 Jan 2027, 09:00 ยท Tue, 05 Jan 2027, 09:00
Common mistakes
- Using a range when you mean exactly two values: 9-21 runs every hour from 9 to 21, while 9,21 runs twice.
- Wrapping a range past the end (22-2). Cron does not wrap; use 22-23,0-2.
Frequently asked questions
Are ranges inclusive?
Yes. 9-17 includes both 9 and 17.