Cron Expression Parser
Read a cron expression in plain words, field by field, before it runs in production at the wrong time.
| minute | */15 | every 15 minutes |
|---|---|---|
| hour | 2 | hour 2 |
| day of month | * | every day of month |
| month | * | every month |
| day of week | 1-5 | day of week Monday through Friday |
The five fields
┌─ minute (0–59)
│ ┌─ hour (0–23)
│ │ ┌─ day of month (1–31)
│ │ │ ┌─ month (1–12)
│ │ │ │ ┌─ day of week (0–7, 0 and 7 are Sunday)
│ │ │ │ │
* * * * *The trap is the interaction between day-of-month and day-of-week: when both are set, most cron implementations run on either, not both. `0 0 1 * 1` fires on the 1st *and* on every Monday.
The other common misreading is `*/15 2 * * *`. It means every 15 minutes during hour 2 — four runs a day — not every 15 minutes.
Shorthand aliases
- @yearly — 0 0 1 1 *
- @monthly — 0 0 1 * *
- @weekly — 0 0 * * 0
- @daily / @midnight — 0 0 * * *
- @hourly — 0 * * * *
Frequently asked questions
Which time zone does a cron job use?
Whatever the machine or scheduler is configured with — cron itself has no time zone. Kubernetes CronJobs default to UTC; a server crontab uses the system zone. This is the single most common cause of a job running an hour off.
Does it support seconds?
This parser handles the standard five fields. Quartz and some libraries add a leading seconds field, making six; those expressions need their own documentation.
What does 0 and 7 both meaning Sunday do?
It is a compatibility quirk — both are accepted, and both mean Sunday, so 1-5 is reliably Monday to Friday.