Codalyst Tech
Developer tools

AI assisted · Free

Cron expression generator

Describe your schedule in natural language — “every weekday at 9am” or “first Monday of the month at midnight” — and get the correct cron expression plus the next 5 run times.

Frequently asked questions

What is the difference between a 5-field and 6-field cron expression?

Standard Unix cron uses 5 fields: minute, hour, day of month, month, and day of week. Some platforms add a seconds field at the beginning (making 6 fields) or a year field at the end. AWS EventBridge and Spring both use 6-field expressions. Always check your platform's documentation before using an expression — a 5-field expression on a 6-field platform will be misinterpreted.

How do I schedule a job on the last day of every month?

Standard 5-field cron does not have a built-in last-day-of-month operator. Some cron implementations support L for last (making it 0 0 L * * for midnight on the last day), but this is not universally supported. A portable workaround is to run the job on the 28th, 29th, 30th, and 31st of each month and have the job itself check whether it is the last day before executing.

What does the asterisk (*) mean in a cron expression?

An asterisk means every possible value for that field. In the minute field, * means every minute. In the day-of-week field, * means every day of the week. Combining * * * in the day, month, and weekday fields means the job runs on every day of every month regardless of the day of the week.

How do I run a job every 15 minutes during business hours only?

The expression */15 9-17 * * 1-5 runs at every 15-minute mark (0, 15, 30, 45) during hours 9 through 17 on weekdays (Monday through Friday, where 1=Monday and 5=Friday). Note that this includes 17:00, 17:15, 17:30, and 17:45 if the range is 9-17. To stop strictly at 17:00, use the range 9-16 instead.

Understanding cron expressions

A standard cron expression has five fields: minute hour day month weekday. Each field can be a specific value, a range, a step value, or * for “every.”

Some platforms (AWS EventBridge, Spring) use a 6-field expression with seconds prepended or a year field appended. Check your platform's documentation before copying an expression directly.

Common patterns:

  • 0 * * * *Every hour at minute 0
  • 0 9 * * 1-5Every weekday at 9:00 AM
  • */15 * * * *Every 15 minutes
  • 0 0 1 * *First day of every month at midnight
  • 0 0 * * 0Every Sunday at midnight

Need to build scheduled jobs, background workers, or data pipelines?

Talk to Codalyst about backend engineering