Knowledge Mark G
Hire Me

Free developer tool

Cron Expression Generator

Build or paste a cron expression, read it in plain English and see exactly when it will run next.

  • No sign-up
  • Instant results
  • Runs in your browser

Expression

Start from a common schedule
Syntax
  • * every value
  • */n every n-th value
  • a-b a range, inclusive
  • a,b,c a list
  • a-b/n every n-th within a range
  • @daily also @hourly, @weekly, @monthly, @yearly

Schedule

In plain English

Every 15 minutes, between 09:00 and 17:59, Monday through Friday.

Next 0 runs (your time zone)

Working out run times…

GitHub Actions and most cloud schedulers run cron in UTC. A Linux server's crontab uses the server's own time zone.

The five cron fields

A cron expression is five fields separated by spaces: minute (0-59), hour (0-23), day of month (1-31), month (1-12 or JAN-DEC) and day of week (0-6 or SUN-SAT, with 7 also meaning Sunday). An asterisk means every value, so * * * * * runs every minute.

Common schedules

  • */5 * * * * - every 5 minutes
  • 0 * * * * - every hour, on the hour
  • 0 0 * * * - every day at midnight
  • 0 9 * * 1-5 - 9am, Monday to Friday
  • 0 0 1 * * - midnight on the first of every month

The rule that catches everyone

When both day-of-month and day-of-week are set, cron runs when either matches. 0 0 1 * 1 runs on the 1st of every month and every Monday - not on Mondays that fall on the 1st. The plain-English description spells this out whenever it applies.

Time zones

A Linux crontab runs in the server’s time zone. GitHub Actions, most cloud schedulers and Kubernetes CronJobs (unless a timeZone is set) run in UTC. Switch the run-time list to UTC to see exactly when a CI job will fire. Containerising the job? The Dockerfile generator writes the image.

Questions people ask

What is the cron expression for every 5 minutes?+

*/5 * * * * - the */5 in the minute field means every fifth minute (0, 5, 10 and so on), every hour of every day.

What does */15 mean in cron?+

Every 15th value of that field. In the minute field, */15 runs at :00, :15, :30 and :45.

How do I run a cron job on weekdays only?+

Put 1-5 in the day-of-week field: 0 9 * * 1-5 runs at 9am Monday to Friday.

Does this support seconds?+

No - standard cron has five fields and no seconds. Six-field expressions (Quartz, Spring) put seconds first; drop that field to use them with crontab or GitHub Actions.

What time zone does GitHub Actions use for cron?+

UTC, always. A schedule of 0 9 * * * runs at 9am UTC, which is 10am in London in summer and 5am in New York.

What do @daily and @hourly mean?+

Shortcuts: @hourly is 0 * * * *, @daily is 0 0 * * *, @weekly is 0 0 * * 0, @monthly is 0 0 1 * * and @yearly is 0 0 1 1 *.