javaJava @Scheduled
@Scheduled(cron = "0 0 0 * * *")fieldsField breakdown
- SEC0at second 00-59
- MIN0at minute 00-59
- HR0at 00:000-23
- DOM*on every day of the month1-31 · L · W
- MON*in every month1-12 · JAN-DEC
- DOW*on every day of the week0-7 · MON-SUN · L · #
next runsNext executions (UTC)
| time | date | in |
|---|---|---|
| 00:00:00 | Mon, 5 Oct 2026 | in 21 hours |
| 00:00:00 | Tue, 6 Oct 2026 | in 2 days |
| 00:00:00 | Wed, 7 Oct 2026 | in 3 days |
| 00:00:00 | Thu, 8 Oct 2026 | in 4 days |
| 00:00:00 | Fri, 9 Oct 2026 | in 5 days |
mistakesCommon mistakes
- Midnight is timezone-dependent. Add zone = "UTC" (or your zone) to @Scheduled to pin it.
- Forgetting that a job at midnight and a job at 09:00 differ by exactly nine fields worth of values, not by one field.