ShareYourGroupShareYourGroupCron Helper

Cron expression for every day at midnight

At 00:00, every day.

Five fields for Linux, GitHub Actions and Kubernetes (minute hour day month weekday). Six or seven for Quartz. Nothing you type leaves your device.

What it means and when to use it

Minute 0, hour 0, and stars after that: the job runs once a day at the start of the day. The shortcut @daily (also written @midnight) is the same thing, and Kubernetes lists both names for 0 0 * * * in its documentation. It is the schedule people reach for first for daily reports, cleanup of temporary files and nightly counters that reset.

Watch out for this

"Midnight" is a poor choice for heavy work: it is when many systems start their own daily tasks, and in some time zones the clock change can make midnight (or 01:00 to 02:00) missing or repeated. The cron manual warns that times that do not exist during a clock change never match, and times that happen twice run twice. A quiet time such as 15 3 * * * (03:15) avoids both. Remember too that a cloud server is often on UTC, so "midnight" there is 05:30 in India.

What each field says

FieldWrittenMeans
Minute00
Hour00
Day of month*every day of the month
Month*every month
Day of week*every day of the week

An example of the next runs

If it were Friday 13 November 2026 at 10:20 UTC, the next six runs would be these. Times are shown in UTC and in India time (UTC+5:30).

UTCIndia time
Sat 14 Nov, 00:00Sat 14 Nov, 05:30
Sun 15 Nov, 00:00Sun 15 Nov, 05:30
Mon 16 Nov, 00:00Mon 16 Nov, 05:30
Tue 17 Nov, 00:00Tue 17 Nov, 05:30
Wed 18 Nov, 00:00Wed 18 Nov, 05:30
Thu 19 Nov, 00:00Thu 19 Nov, 05:30

The same schedule in other places

Quartz

Quartz has a seconds field in front, uses ? in one day field, and counts Sunday as 1:

0 0 0 * * ?

GitHub Actions

Scheduled workflows run in UTC unless you add a time zone. In the workflow file:

on:
  schedule:
    - cron: '0 0 * * *'

Kubernetes CronJob

In a CronJob manifest the schedule goes in spec.schedule. Without spec.timeZone, it is read in the time zone of the cluster's controller:

spec:
  schedule: "0 0 * * *"
  timeZone: "Etc/UTC"

A crontab line to copy

The command is made up. Replace it with your own and use full paths:

0 0 * * * /home/me/bin/daily-report.sh >> /home/me/report.log 2>&1

Questions

Does @daily work everywhere?

Vixie-style cron and Kubernetes accept it. Quartz and the GitHub Actions page do not list it, so write the five fields there.

What time is midnight in cron?

00:00 in the time zone the cron program uses. That is the server time zone unless you set CRON_TZ or, on Kubernetes and GitHub Actions, the time zone setting.

This is an independent guide and tool. It is not connected with crontab.guru, Quartz, GitHub, Kubernetes, Spring or the Linux projects named here. Product names belong to their owners.