What is Day of Week Field?

The fifth field in a cron expression, specifying which weekdays (0-7 or SUN-SAT) the job runs.

Definition

The day-of-week field is the fifth and final field in a standard cron expression. It accepts values 0-7 (where both 0 and 7 represent Sunday) or three-letter abbreviations (SUN, MON, TUE, etc.). It restricts execution to specific days of the week. The range 1-5 represents Monday through Friday (business days).

๐Ÿ’ก

Simple Analogy

Like setting a weekly alarm that only goes off on certain days โ€” you can pick Monday, Wednesday, Friday and skip the rest.

Why It Matters

Critical for business-day scheduling. Most business automations should only run Monday-Friday. Weekend executions of payroll jobs, business reports, or customer notifications are usually unwanted and can cause confusion or errors.

How to Verify

Use the Cron Explainer and check that the next 7+ runs only show on the expected days. Pay special attention to the Sunday numbering: both 0 and 7 mean Sunday in most implementations, but some older systems only accept 0.

โš ๏ธ

Common Mistakes

Confusing 0-based and 1-based numbering. In standard cron, 0 = Sunday, 1 = Monday. Using both day-of-month and day-of-week with specific values creates an OR condition, not AND โ€” "15 * * * 5" means "the 15th of any month OR any Friday," not "Friday the 15th."

โœ…

Best Practices

Use 1-5 for weekdays (Monday-Friday). Prefer numeric values over abbreviations for portability. If you need "Friday the 15th" logic, handle it in your application code, not in cron (use a daily job that checks if today is both Friday and the 15th).

Cron Expression Generator

Build your cron expression

Try it free โ†’

Frequently Asked Questions

What is Day of Week Field?

The day-of-week field is the fifth and final field in a standard cron expression. It accepts values 0-7 (where both 0 and 7 represent Sunday) or three-letter abbreviations (SUN, MON, TUE, etc.). It restricts execution to specific days of the week. The range 1-5 represents Monday through Friday (business days).

Why does Day of Week Field matter for cron jobs?

Critical for business-day scheduling. Most business automations should only run Monday-Friday. Weekend executions of payroll jobs, business reports, or customer notifications are usually unwanted and can cause confusion or errors.

What are best practices for Day of Week Field?

Use 1-5 for weekdays (Monday-Friday). Prefer numeric values over abbreviations for portability. If you need "Friday the 15th" logic, handle it in your application code, not in cron (use a daily job that checks if today is both Friday and the 15th).

Related Terms