Skip to content
CronExplain

Spring Cron Expression Explainer

Spring’s @Scheduled(cron = "...") annotation uses a six-field cron format with seconds first. Paste a Spring expression to read it in plain language and check its next run times in your server’s time zone.

What it means

Spring @Scheduled: six fields with seconds first, 0 or 7 = Sunday; supports L, W, # and macros such as @daily.

✓ Valid · What it means

At 09:00 AM, Monday through Friday

Presets

Next 10 runs

#In UTCYour local time
1——
2——
3——
4——
5——
6——
7——
8——
9——
10——

Same schedule in other dialects

  • Standard crontab0 9 * * 1-5
  • Quartz0 0 9 ? * MON-FRI
  • AWS EventBridgecron(0 9 ? * MON-FRI *)EventBridge rules use UTC.

Visual builder

Pick values per field. The builder writes a standard five-field expression; it is converted to the selected dialect when you use it.

Minute
Hour
Day of month
Month
Day of week
0 9 * * 1-5

Spring cron format

A Spring expression has six fields: second, minute, hour, day of month, month and day of week, for example 0 0 9 * * MON-FRI for 09:00 on weekdays. Sunday can be written as 0, 7 or SUN. Since Spring Framework 5.3 the parser also understands L, W and # in the day fields, plus macros such as @hourly and @daily.

Time zone of @Scheduled

By default expressions are evaluated in the server’s default time zone. Set the zone attribute, for example @Scheduled(cron = "0 0 2 * * *", zone = "Europe/Paris"), to make the schedule independent of the host. Choose the same zone in the tool to preview the runs.

Spring vs Quartz

Spring expressions look like Quartz ones but differ in details: there is no year field, Sunday is 0 rather than 1, and “?” is accepted but not required. When both day fields are restricted Spring requires both to match. The converter shows the Quartz equivalent when it exists.

Enabling scheduling

Cron methods only run when scheduling is switched on with @EnableScheduling. By default Spring uses a single thread, so a long task delays every other scheduled method; configure a ThreadPoolTaskScheduler or spring.task.scheduling.pool.size when you have several jobs. In a cluster every instance fires the same cron, so use a lock such as ShedLock if a job must run only once.

Frequently asked questions

Why does Spring say my cron expression must have six fields?
Spring needs a seconds field. Prepend 0 to a five-field crontab expression: 0 */5 * * * * runs every five minutes.
How do I disable a @Scheduled cron job?
Use the special value "-" (Scheduled.CRON_DISABLED), usually through a property placeholder.
Does Spring support the last day of the month?
Yes, since 5.3: 0 0 0 L * * runs at midnight on the last day of every month.
Can I read the cron expression from configuration?
Yes, for example @Scheduled(cron = "${jobs.cleanup.cron}"), so the schedule can change per environment.