The 12 abbreviations
| Name | Number |
|---|---|
| JAN | 1 |
| FEB | 2 |
| MAR | 3 |
| APR | 4 |
| MAY | 5 |
| JUN | 6 |
| JUL | 7 |
| AUG | 8 |
| SEP | 9 |
| OCT | 10 |
| NOV | 11 |
| DEC | 12 |
Case-insensitive on all modern systems — jan, Jan, and JAN all work.
Examples
0 0 1 JAN * # January 1st at midnight (yearly) 0 0 1 JAN,APR,JUL,OCT * # First of each quarter 0 0 * MAR-MAY * # Every day in March, April, May (spring) 0 9 * JUN-AUG MON-FRI # Weekday mornings during summer 0 0 25 DEC * # December 25 at midnight
Platform support
| Platform | Named months work? |
|---|---|
| Vixie cron (most Linux) | Yes |
| BSD cron | Yes |
| Quartz | Yes |
| AWS EventBridge | Yes |
| Spring @Scheduled | Yes |
| GitHub Actions | Yes |
| Kubernetes CronJob | Yes |
| Azure Functions NCRONTAB | Yes |
| Jenkins | Yes |
Universal support — there's no portability cost to using names.
Ranges and lists with names
You can combine names with ranges and lists:
0 0 * MAR-MAY * # Range: March through May 0 0 * JAN,JUL * # List: January and July 0 0 * MAR-MAY,SEP * # Mixed: March-May AND September
Can't combine names with steps
Most implementations don't support step values mixed with names:
# Won't work everywhere: 0 0 * JAN-DEC/2 * # Use numbers instead: 0 0 * */2 * # Every other month (Jan, Mar, May, Jul, Sep, Nov) 0 0 * 1-12/2 * # Same, explicit range
Why use names?
Two reasons:
- Readability.
0 0 25 DEC *is obviously Christmas.0 0 25 12 *requires you to count. - Mistake-prevention. Hard to write the wrong month if you spell it out.
The same reasoning applies to day-of-week names (MON-FRI vs 1-5).