Understanding cron expressions: write schedules like a developer
Cron expressions control when automated tasks run on servers, cloud platforms, and scheduling tools—yet most developers resort to copying examples and hoping they work. Understanding cron syntax means you can confidently write any schedule from scratch, debug failing jobs faster, and avoid costly mistakes like backups that never run.
What cron expressions are and why they matter
A cron expression is a compact string of five or six fields that tells a system exactly when to execute a task. It is the standard format across Unix servers, Linux, GitHub Actions, AWS EventBridge, Kubernetes, and CI/CD platforms worldwide. Instead of writing prose like "run this every Tuesday at 2 AM," you write 0 2 * * 2, and the cron daemon interprets it instantly. Learning this notation—which has remained virtually unchanged for decades—is a one-time investment that pays off every time you schedule anything.
The five fields and their ranges
Standard cron uses five mandatory fields separated by spaces. Read them left to right as minute, hour, day of month, month, and day of week:
Minute(0–59) — which minute of the hour to runHour(0–23) — which hour of the day (24-hour clock)Day of month(1–31) — which calendar dayMonth(1–12) — which month of the yearDay of week(0–7) — which day of the week, where both 0 and 7 mean Sunday
Each field accepts a specific value, a range like 1-5, a list like 1,3,5, or a wildcard * meaning "every value in that field." The slash operator divides ranges: */15 in the minute field means every 15 minutes.
Common patterns you will write
Most real-world schedules repeat just a few ways. Weekday mornings at 9 AM is 0 9 * * 1-5. Every hour is 0 * * * *. First day of the month at midnight: 0 0 1 * *. Every 15 minutes, all day: */15 * * * *. Once a day on Sunday at 2:30 AM: 30 2 * * 0. If you are ever uncertain whether your expression is right, paste it into a cron parser to see the next five scheduled runs and verify it matches your intent before deploying.
Build your own cron expression
Start in English, then translate to cron. You want "9:30 AM every weekday"? That is 30 minutes, 9 hours, any day of month, any month, Monday through Friday. Fields become 30 9 * * 1-5. For "twice a day at 7 AM and 6 PM": 0 7,18 * * * (comma separates hours). Noon on the 15th every month: 0 12 15 * *. Once you write any expression, always test it with the parser to catch typos before you deploy.
Handle timezones and verify exact times
Cron expressions are server-relative—they run in the timezone of the system, not your local timezone. To verify a Unix timestamp or see what local time your cron fires in your zone, use the timestamp converter, which runs in your browser and handles timezone conversions instantly without sending data anywhere.
Turn your schedule into a calendar event
Once you have a solid cron expression, share it or add it to your calendar so you see when the task runs. The ICS generator converts a start date and recurrence rule into a calendar file that imports into Apple Calendar, Google Calendar, Outlook, or any standard calendar app. Alternatively, create a direct Google Calendar link that opens the event pre-filled in Google Calendar with a single click—no downloads, no file management.
Your cron schedules stay private
All tools mentioned here run inside your browser; nothing is uploaded to a server. Cron parsing, timestamp conversion, calendar generation, and link creation all happen on your device. No account, no tracking, and the tools work offline after they load. Your schedules and automation details remain yours alone.