Cron's Weird Design Choice: Why Sunday Can Be Both 0 and 7
Published 2026-09-14
A genuinely strange but intentional overlap
In the standard cron format, the day-of-week field runs from 0 to 7, where both 0 and 7 represent Sunday — not a typo, but a deliberate accommodation for two different numbering conventions that existed before cron settled on a single standard. Some older systems and standards number the week starting from Sunday as 0, while others (following the ISO 8601 international standard) number Monday as 1 through Sunday as 7. Rather than forcing everyone to pick one, cron's designers made both work.
Where cron itself comes from
Cron originated in early Unix systems in the 1970s (the name comes from "chronos," Greek for time) as a way to schedule recurring jobs — backups, log rotation, maintenance scripts — without a human needing to trigger them manually. Its compact five-field syntax (minute, hour, day of month, month, day of week) has remained essentially unchanged for roughly five decades, which is a remarkable run for a piece of command-line syntax, and is exactly why it's still the standard scheduling format across countless modern tools far beyond Unix itself, including cloud schedulers and CI/CD pipelines.
The most common real-world cron mistakes
- Mixing up day-of-month and day-of-week: since both fields exist, it's easy to put a value in the wrong one, especially since combining both fields with an AND (rather than an OR, which is how cron actually treats them by default) is a frequent point of confusion.
- Forgetting time zones: cron typically runs on the server's local time or UTC depending on configuration, which has caused countless "why did this job run at the wrong time" incidents when a schedule was written assuming a different time zone than the server actually uses.
- Off-by-one errors in month numbering: cron's month field runs 1-12 (January = 1), not 0-11 like some programming languages' date objects — a mismatch that occasionally causes a schedule ported from application code to be a month off.
Check your expression before deploying it
Because a wrong cron expression often doesn't fail loudly — it just quietly runs at the wrong time, or not at all — it's worth double-checking one in plain English before it goes live. Our Cron Expression Generator explains any cron expression in plain language, and can build one from simple fields or common presets if you'd rather not write the syntax by hand.