Run a cron job daily at midnight: 0 0 * * * explained
0 0 * * * runs a job at exactly midnight (00:00) every day. The first zero fixes the minute to :00, the second zero fixes the hour to 0 (midnight in 24-hour time). This is the standard pattern for daily database backups, report generation, and log summarization.
How this is calculated
Midnight cron jobs run in the server's local timezone, which is typically UTC on cloud VMs and containerized environments. A 0 0 * * * job on a UTC server runs at 00:00 UTC, which might be 5 PM or 8 PM in your local time depending on your timezone. If you need the job to run at local midnight, either set the server's timezone or adjust the hour field: for EST (UTC-5), use 0 5 * * *. The @daily and @midnight shortcuts are equivalent to 0 0 * * *.
Verdict
0 0 * * * is correct for daily midnight execution, but always confirm the server timezone first. A job you think runs at midnight local time might actually be firing in the middle of the afternoon. Document the intended timezone next to the cron expression in your crontab.
More Cron scenarios
Frequently asked questions
What is a Cron Job?
What do the 5 parts of a cron expression mean?
What does the asterisk (*) mean in Cron?
How do I run a task every 5 minutes?
Related tools
Unix Timestamp
Convert between Unix timestamps and human-readable dates.
Use tool ➜CHMOD Configurator
Calculate Linux file permissions using checkboxes, octal numbers, or symbolic notation.
Use tool ➜Text Encoding Converter
Convert between Text, Base64, Binary, Hexadecimal, and Decimal formats.
Use tool ➜