How "Every Day at Midnight" (0 0 * * *) Works Across Schedulers
The standard 5-field POSIX cron expression 0 0 * * * schedules execution every day at midnight (00:00:00 every calendar day), totaling 1 run/day (365 runs/year). Teams commonly rely on this cadence for daily quota resets, logrotate triggers, date-partitioned table creation, and end-of-day UTC ledger closings. When deploying to AWS EventBridge Rules or Scheduler, translate it to the 6-field syntax cron(0 0 * * ? *) with the mandatory ? wildcard and trailing Year field; for 6-field seconds-first engines like Spring @Scheduled or Azure Functions NCRONTAB, use 0 0 0 * * *.
0 0 * * * is the single most crowded timestamp on the internet (matching @daily and @midnight). On shared infrastructure or GitHub Actions, consider 05 0 * * * or 13 0 * * * to dodge midnight CPU and queue spikes.
- POSIX / K8s / GitHub0 0 * * * — Daily at 00:00 (12:00 AM, equivalent to @daily) (00:00:00 every calendar day).
- AWS EventBridge & SpringAWS: cron(0 0 * * ? *) · Spring / Azure 6-field: 0 0 0 * * *.
- Execution Cadence1 run/day (365 runs/year). Typical workloads: daily quota resets, logrotate triggers, date-partitioned table creation, and end-of-day UTC ledger closings.
What is the exact cron expression for every day at midnight?
Use 0 0 * * * for Linux crontab, Kubernetes CronJob, GitHub Actions, and GCP Cloud Scheduler. Use cron(0 0 * * ? *) for AWS EventBridge, and 0 0 0 * * * for Spring @Scheduled and Azure Functions NCRONTAB.
Is 0 0 * * * equivalent to @daily and @midnight?
Yes. In Vixie cron, Kubernetes, and Spring 5.3+, @daily and @midnight are exact shorthands for 0 0 * * * (0 0 0 * * * in Spring).