Parse CRON expressions and preview upcoming execution times
Cron is a time expression format used in Unix/Linux systems to define scheduled tasks. By combining 5 fields, you can precisely describe execution schedules — from every minute to specific dates each year. Modern cloud platforms (AWS CloudWatch, GitHub Actions, Kubernetes CronJob) all use similar syntax.
┌──── Minute 0-59
│ ┌── Hour 0-23
│ │ ┌─ Day 1-31
│ │ │ ┌ Month 1-12
│ │ │ │ ┌ Weekday 0-7 (0 and 7 are both Sunday)
* * * * *
* any value · , multiple values (1,15) · - range (9-17) · / step (*/5)
| Expression | Meaning |
|---|---|
0 * * * * |
Every hour on the hour |
0 0 * * * |
Daily at midnight |
*/15 * * * * |
Every 15 minutes |
0 9 * * 1-5 |
Weekdays at 9:00 AM |
0 2 * * 0 |
Every Sunday at 2:00 AM |
30 4 1 * * |
1st of every month at 4:30 AM |
Note: Spring CRON uses 6 fields (adds "seconds" at the front), and Quartz uses 7 fields (adds "year" at the end) — both differ from the standard 5-field format.
*/5 and 0,5,10,...?They are functionally equivalent — */5 is syntactic sugar for step values. However, some older cron implementations don't support the / syntax, requiring you to list all values explicitly.
Standard 5-field Cron doesn't support "last day" semantics. Workarounds include using 28-31 with an in-script date check, or using extended formats that support the L symbol (e.g., Quartz's 0 0 L * ?).
Common causes: server timezone mismatch (check the TZ environment variable), syntax errors in the crontab file (missing trailing newline), script paths not using absolute paths, or task output not redirected causing mail queue buildup.