Spring @Scheduled Cron Expression Generator
Spring's @Scheduled annotation uses a six-field cron expression — the key difference from Unix cron is a leading Seconds field. Miss that and a schedule you expect to run hourly will look like it runs every minute.
Build your expression below and copy the ready-to-paste @Scheduled annotation into your Spring bean.
Expression
Tip: press Ctrl+Enter to copy
Presets
Visual Builder
Description
At 09:00 AM, Monday through Friday
Spring cron syntax
| Sec | Min | Hour | Day | Month | DOW |
|---|---|---|---|---|---|
| 0 | 0 | 9 | * | * | MON-FRI |
- Six fields: Seconds, Minutes, Hours, Day-of-month, Month, Day-of-week.
- Used as @Scheduled(cron = "..."), typically on a method in a @Component or @Configuration class.
- Day-of-week accepts 0-7 (both 0 and 7 are Sunday) or names like MON-FRI.
- Supports macros such as @daily, @hourly, and @weekly in place of the fields.
- Set the timezone with the zone attribute, e.g. @Scheduled(cron = "...", zone = "Europe/Paris").
Spring cron examples
Click any example to load it into the generator above.
Frequently asked questions
Why does Spring cron have six fields?
Spring's cron format adds a Seconds field at the front, so the order is Seconds, Minutes, Hours, Day-of-month, Month, Day-of-week. A standard five-field Unix expression won't parse — prefix it with a seconds value (often 0).
How do I set the timezone for a Spring scheduled task?
Use the zone attribute on the annotation: @Scheduled(cron = "0 0 9 * * MON-FRI", zone = "Europe/Paris"). Without it, Spring uses the server's default timezone.
Can I use macros instead of a full expression?
Yes. Spring supports @yearly, @monthly, @weekly, @daily, and @hourly as shortcuts, which can be clearer than the equivalent six-field expression.