cronuru
Pattern

Daily at Midnight

0 0 * * *
0 0 0 * * ?
0 0 * * *
0 0 * * ? *
0 0 0 * * *
0 0 * * *

Runs once a day at 00:00 (midnight). One invocation per day.

Use in your stack

# Daily at midnight (uses server timezone)
0 0 * * * /usr/local/bin/nightly-backup.sh

# Pin to UTC
CRON_TZ=UTC
0 0 * * * /usr/local/bin/nightly-backup.sh
{ "cron": "0 0 0 * * ?", "timezone": "UTC" }
apiVersion: batch/v1
kind: CronJob
metadata:
  name: nightly-backup
spec:
  schedule: "0 0 * * *"
  timeZone: "UTC"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: backup
            image: my-image:latest
          restartPolicy: OnFailure
cron(0 0 * * ? *)   # 00:00 UTC daily
@Scheduled(cron = "0 0 0 * * *", zone = "UTC")
public void nightlyJob() { /* ... */ }
on:
  schedule:
    - cron: '0 0 * * *'   # 00:00 UTC daily

Next runs

Pick a timezone to see when this expression fires next.

Next 10 runs
  1. 012026-07-04T00:00:00.000Z
  2. 022026-07-05T00:00:00.000Z
  3. 032026-07-06T00:00:00.000Z
  4. 042026-07-07T00:00:00.000Z
  5. 052026-07-08T00:00:00.000Z
  6. 062026-07-09T00:00:00.000Z
  7. 072026-07-10T00:00:00.000Z
  8. 082026-07-11T00:00:00.000Z
  9. 092026-07-12T00:00:00.000Z
  10. 102026-07-13T00:00:00.000Z

Variations

Common use cases

  • Nightly database backups.
  • Daily log rotation or compaction.
  • Generating end-of-day reports or invoices.
  • Overnight ETL jobs that aggregate the previous day's data.

Gotchas

  • Timezone matters: 00:00 UTC is not 00:00 local time unless your server is in UTC. Pin the timezone with `CRON_TZ=UTC` in crontab or `spec.timeZone: UTC` on a Kubernetes CronJob.
  • AWS EventBridge and GitHub Actions are always UTC — there's no per-job timezone.
  • On daylight saving spring-forward days, a `0 2 * * *` job (2 AM) may skip. A 0:00 job is generally safe but watch for jurisdictions that transition near midnight.
  • On Linux crontab, `@daily` is shorthand for `0 0 * * *`. Kubernetes CronJob accepts it; GitHub Actions does not.

0 0 * * * is the canonical nightly job. The two leading zeros set the time to exactly 00:00, and the three trailing asterisks mean “every day, every month, every weekday.” Watch the timezone — the most common production incident is a job that “should run at midnight” but actually runs at 7 AM PST because the server is in UTC.

Frequently asked questions

What does `0 0 * * *` mean?
Minute = 0, hour = 0, day of month = any, month = any, day of week = any. So the job runs at 00:00 (midnight) every day. One invocation per day.
What timezone does `0 0 * * *` use?
It depends on the scheduler. Traditional Unix cron uses the system's local timezone. Kubernetes CronJob defaults to UTC unless `spec.timeZone` is set. AWS EventBridge and GitHub Actions are always UTC. Spring `@Scheduled` accepts a `zone` parameter; otherwise it uses the JVM's default timezone.
Is `0 0 * * *` the same as `@daily` or `@midnight`?
Yes. Linux crontab accepts `@daily` and `@midnight` as shortcuts for `0 0 * * *`. Anacron and Kubernetes CronJob accept `@daily`. GitHub Actions does not support either shortcut — write the full expression.
What about daylight saving?
A 0:00 daily job is one of the safer schedules because most DST transitions happen at 2:00 or 3:00 local time. A job scheduled at `0 2 * * *` (2 AM) can skip on spring-forward day or run twice on fall-back day. Pin to UTC if you want predictable runs across DST transitions.

Browse all cron patterns

Every schedule Cronuru documents, with its expression and code snippets for six dialects.