Reference

Cron month names.

The cron month field accepts both numbers (1-12) and three-letter abbreviations (JAN-DEC). Named months are more readable and avoid the rare confusion of 0-indexed vs 1-indexed.

The 12 abbreviations

NameNumber
JAN1
FEB2
MAR3
APR4
MAY5
JUN6
JUL7
AUG8
SEP9
OCT10
NOV11
DEC12

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

PlatformNamed months work?
Vixie cron (most Linux)Yes
BSD cronYes
QuartzYes
AWS EventBridgeYes
Spring @ScheduledYes
GitHub ActionsYes
Kubernetes CronJobYes
Azure Functions NCRONTABYes
JenkinsYes

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:

  1. Readability. 0 0 25 DEC * is obviously Christmas. 0 0 25 12 * requires you to count.
  2. 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).

Related

Continue reading.