Cron Expression for Every Day at Midnight
0 0 * * *0 0 * * * runs once a day at 00:00 — midnight in whatever timezone your cron daemon uses, which on most servers is UTC, not your local midnight.
Next runs, in your timezone
Midnight in which timezone?
Cron evaluates expressions in the daemon's timezone. A server on UTC runs this at 02:00 or 03:00 Helsinki time depending on the season. Either set CRON_TZ (supported by modern cronies), schedule in a tool with a real timezone field, or embrace UTC and stop translating.
CRON_TZ=Europe/Helsinki
0 0 * * * /path/to/job.sh >> /var/log/nightly.log 2>&1Why midnight is a bad time anyway
Everything runs at midnight: log rotation, backups, other people's nightly jobs. If the exact hour does not matter, an arbitrary offset like 23 minutes past 3 gets the same daily cadence with none of the contention.
23 3 * * * /path/to/job.shDST note
In timezones with daylight saving, 00:00 exists on every calendar day in almost all zones, so midnight jobs are DST-safe. Times between 02:00 and 03:00 are the ones that get skipped or repeated on transition nights.
Equivalent expressions
@daily— alias for 0 0 * * * in Vixie cron and most compatibles@midnight— same alias, different name
Run a SQL query on this schedule
If the job behind this schedule is a database query, you can skip the server and the crontab: SaturnSQL runs saved SQL queries on a cron expression — this exact syntax, with a real timezone field — and delivers the results to Google Sheets or Slack. Minimum interval 5 minutes.