Cron expression generator

A cron expression is five fields that tell a scheduler when to run a job: minute, hour, day of month, month and day of week. Type one to read it in plain English, see its next five runs in your time zone, and copy it as a Kubernetes CronJob with the time zone already set.

minute · hour · day of month · month · day of week

At 9:00 AM, on Monday through Friday.

Minute
0
minute 0
Hour
9
9:00 AM
Day of month
*
every day
Month
*
every month
Day of week
1-5
Monday through Friday

Next 5 runs

Working out run times…

Kubernetes CronJob

apiVersion: batch/v1
kind: CronJob
metadata:
  name: my-job
spec:
  schedule: "0 9 * * 1-5"
  timeZone: "UTC"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: my-job
              image: busybox:1.28
              command: ["/bin/sh", "-c", "date; echo Hello from the Kubernetes cluster"]
          restartPolicy: OnFailure

How to read a cron expression

Read the fields left to right. Each field lists the values it runs on. The job runs when the clock matches every field, with one exception below.

The five fields of 0 9 * * 1-50 is the minute, 9 the hour, the first star the day of month, the second star the month, and 1-5 the day of week. Together: 9:00 AM, Monday through Friday.0minute9hour*day of month*month1-5day of week= At 9:00 AM, on Monday through Friday.
Field
Values
Example
Minute
0 to 59
30 is half past the hour
Hour
0 to 23
9 is 9 AM, 17 is 5 PM
Day of month
1 to 31
1,15 is the 1st and 15th
Month
1 to 12 or jan to dec
*/3 is every third month
Day of week
0 to 7 or sun to sat (0 and 7 are Sunday)
1-5 is Monday to Friday

Four symbols do the rest:

  • * means every value, so a star in the hour field is every hour.
  • , makes a list: 0,30 in the minute field is on the hour and half past.
  • - makes a range, and both ends count: 9-17 is 9 AM through 5 PM.
  • / sets a step. */5 in the minute field means every fifth minute (0, 5, 10 and so on), so */5 * * * * runs every 5 minutes. A step counts inside its own field only: */23 in the hour field runs at midnight and 11 PM, not every 23 hours.

Month and day names work too. Use the first three letters, upper or lower case, like mon-fri or jan,jul.

When you set both day fields

This rule trips people up. When both day of month and day of week are set, cron runs on days that match either one, not both. 30 4 1,15 * 5, the example in the crontab(5) manual, doesn't mean "Fridays that fall on the 1st or 15th". It runs at 4:30 AM on the 1st, the 15th and every Friday.

Days 30 4 1,15 * 5 runs in November 2026It runs on 6 days: 1, 6, 13, 15, 20, 27. The 1st and 15th come from the day of month field, and every Friday from the day of week field.SMTWTFS123456789101112131415161718192021222324252627282930
November 2026: the 1st, the 15th and every Friday.

Put a * in either day field and the rule is off: the other field decides alone. And if you only want those Fridays, schedule every Friday and have the job check the date.

Common cron expressions

Expression
Runs
*/5 * * * *
Every 5 minutes.
0 * * * *
Every hour, on the hour.
0 0 * * *
At 12:00 AM, every day.
0 9-17 * * 1-5
Every hour from 9:00 AM through 5:00 PM, on Monday through Friday.
0 0 1 * *
At 12:00 AM, on the 1st of the month.
0 3 * * 0
At 3:00 AM, on Sunday.

Cron with 5 or 6 fields

Standard cron, the kind in a crontab and in Kubernetes, has five fields. Quartz, the Java scheduler, uses six or seven: it puts seconds first and an optional year last. To move 0 0 9 * * ? to a 5-field scheduler, drop the leading seconds and write the ? as *: 0 9 * * *. Kubernetes and the tool both read a ? in a day field as a star, but crontab doesn't list it.

Every 5 seconds? Standard cron can't. It checks its schedule once a minute, so a minute is the smallest step. For anything faster, run a loop inside the job.

Run it as a Kubernetes CronJob

A Kubernetes CronJob takes the same five fields in spec.schedule. Three things catch people out:

  • The time zone. Without spec.timeZone, the schedule follows the cluster controller's local time zone. Set it to a name like America/New_York or Etc/UTC. The field is stable since Kubernetes 1.27.
  • No time zone in the schedule. Kubernetes rejects a schedule that includes a CRON_TZ= or TZ= time zone.
  • Sunday is 0. Kubernetes lists day of week as 0 to 6, so write Sunday as 0, not 7.

@hourly, @daily, @weekly, @monthly and @yearly work in both crontab and Kubernetes. Type one into the tool to see the five fields behind it.

Cron and daylight saving time

Daylight saving bites cron jobs twice a year. On the night clocks jump forward, a time in the skipped hour never comes, so cron skips the job. On the night they fall back, a time in the repeated hour comes twice, so cron runs it twice. Our advice: unless a job has to fire at a local clock time, schedule it in UTC. UTC has no daylight saving, so neither can happen.

Run your cron jobs on American Cloud

A schedule needs somewhere to run. On American Cloud, that's a cron entry (or a systemd timer) on your own VM, or a CronJob on our managed Kubernetes, where the first control node is free. Moving off Heroku Scheduler or Vercel cron? Our Heroku and Vercel migration guides cover moving the jobs. And if a job doesn't run when you expected, ask us: our support team's median reply time is under 2 minutes.

Contact us