>_

Cron expression for every 12 hours

To run a job every 12 hours, use the cron expression below. It means: On the hour, every 12 hours, every day.

0 */12 * * * On the hour, every 12 hours, every day

Field by field

Field Value Meaning
Minute 0 exactly 0
Hour */12 every 12
Day of month * any
Month * any
Day of week * any

Try it

minutehourday (month)monthday (week)

Presets

Next runs (your local time)

    Syntax on different platforms

    Linux crontab

    # crontab -e
    0 */12 * * * /path/to/script.sh >> /var/log/job.log 2>&1

    GitHub Actions

    on:
      schedule:
        - cron: '0 */12 * * *'  # UTC

    Kubernetes CronJob

    apiVersion: batch/v1
    kind: CronJob
    metadata:
      name: my-job
    spec:
      schedule: "0 */12 * * *"
      timeZone: "America/New_York"
      jobTemplate:
        spec:
          template:
            spec:
              containers:
                - name: job
                  image: busybox
                  command: ["date"]
              restartPolicy: OnFailure

    Spring @Scheduled

    // Spring has an extra seconds field first
    @Scheduled(cron = "0 0 */12 * * *")
    public void run() { /* ... */ }

    Note: cron runs in the time zone of the machine or platform. Servers and GitHub Actions usually use UTC; Kubernetes lets you set timeZone.

    More examples

    Open the full Cron Expression Parser →