
Cron Expressions Explained: Fields, Timezones and Safe Scheduling
Learn how five-field cron schedules work, why timezone and daylight-saving rules matter, and how to verify the next runs before deployment.
A cron expression is compact, but a one-character mistake can schedule a job hundreds of times too often or prevent it from running at all. The safest way to review a schedule is to understand each field, calculate real upcoming dates in the same timezone as the target system, and then test the command separately from the schedule.
The standard five fields
The common Unix format is minute hour day-of-month month day-of-week. The expression 30 8 * * 1-5 means minute 30, hour 8, every day of the month, every month, Monday through Friday. Asterisks mean every allowed value; commas create lists, hyphens create ranges and a slash selects steps such as */15.
| Field | Typical range | Example |
|---|---|---|
| Minute | 0–59 | */15 |
| Hour | 0–23 | 8 |
| Day of month | 1–31 | 1 |
| Month | 1–12 | 1,7 |
| Day of week | 0–7 | 1-5 |
Day-of-month and day-of-week can surprise you
Traditional cron implementations often treat the two day fields with OR-like behaviour when both are restricted: a job may run when either field matches. Platform dialects differ, so avoid combining both constraints unless the target documentation clearly explains the rule. Separate schedules are usually easier to review.
Timezone is part of the schedule
0 9 * * * does not fully describe “9 AM” until a timezone is known. Servers and cloud schedulers frequently use UTC, while a business requirement may refer to Casablanca, Paris or New York time. Some platforms offer a timezone setting; others require converting the desired local time to UTC.
Daylight-saving transitions create two special cases: a local time may not exist when clocks move forward, or may occur twice when clocks move backward. A timezone-aware preview exposes the next actual timestamps, but the platform still decides whether a missed or duplicated local time is skipped, delayed or repeated.
Examples worth verifying
*/15 * * * *: every fifteen minutes.0 9 * * *: daily at 09:00 in the scheduler's timezone.30 8 * * 1-5: weekdays at 08:30.0 0 1 * *: midnight on the first day of each month.0 2 * * 0: every Sunday at 02:00, with a daylight-saving caveat.
A production-safe checklist
- Confirm whether the platform expects five, six or seven fields.
- Confirm its timezone and daylight-saving behaviour.
- Calculate at least five upcoming dates and inspect month or year boundaries.
- Run the command manually with the same user, environment variables and working directory.
- Add locking or idempotency so overlapping executions cannot corrupt data.
- Log start, completion, duration and failure details.
- Configure monitoring for missed runs, not only command errors.
Cron schedules do not guarantee execution
Cron determines when a task becomes eligible to start. A powered-off machine, a paused container, queue pressure, a previous run that is still active or a platform outage can change the outcome. Critical billing, backup and notification workflows need retries, idempotency and an independent monitor.
Security considerations
Use absolute executable and file paths, grant the job only the permissions it needs, and keep secrets in the platform's protected environment rather than in the expression or command line. Treat any data used to build shell commands as untrusted. A valid schedule says nothing about command safety.
Check the platform dialect
The Linux crontab manual documents traditional behaviour. GitHub Actions, Kubernetes CronJobs, Vercel Cron Jobs and managed cloud schedulers have their own limits and syntax. Use the ToolBlur parser to understand and preview a standard five-field expression, then verify the final schedule against the documentation of the system that will execute it.
A good cron schedule is not merely syntactically valid. It is understandable to another person, produces the expected upcoming dates, survives retries and timezone changes, and is monitored after deployment.