Platform schedule guide

Spring @Scheduled Cron Expression Guide

Learn Spring cron syntax for @Scheduled: six fields with seconds, timezone configuration, macros, L/W/# support, examples, overlap risks, and differences from Unix and Quartz.

Platform behavior reviewed against the official documentation on August 5, 2026.

Format
6 fields, seconds first
Timezone
Scheduler default or zone
Weekday numbering
0 or 7 = Sunday
Readable aliases
@hourly, @daily, …

Overview

Spring Framework schedules application methods with @Scheduled. A Spring cron expression has six fields, beginning with seconds, and can be resolved in an explicit timezone through the annotation’s zone attribute.

Spring is often described as using “Quartz cron,” but the formats are not interchangeable. Spring has no year field and follows the Unix weekday convention where Sunday is 0 or 7, while Quartz numbers Sunday as 1. Spring does support useful Quartz-style day modifiers such as L, W, and #.

In a distributed Spring Boot deployment, every application instance normally registers the scheduled method. If exactly one cluster-wide execution is required, add distributed coordination or move the trigger to an external scheduler.

Spring cron expression format

A Spring expression contains second, minute, hour, day-of-month, month, and day-of-week. It supports names such as MON and JAN plus lists, ranges, steps, and advanced day modifiers.

To convert a five-field Unix schedule, usually prepend 0 for seconds. For example, Unix 0 9 * * 1-5 becomes Spring 0 0 9 * * MON-FRI.

┌───────────── second (0-59)
│ ┌───────────── minute (0-59)
│ │ ┌───────────── hour (0-23)
│ │ │ ┌───────────── day of month (1-31)
│ │ │ │ ┌───────────── month (1-12 or JAN-DEC)
│ │ │ │ │ ┌───────────── day of week (0-7 or MON-SUN)
│ │ │ │ │ │
* * * * * *
Spring Framework schedule fields and valid values
FieldPositionValuesPlatform note
Second10-59Use 0 for minute-level schedules converted from Unix cron.
Minute20-59Lists, ranges, and step values are supported.
Hour30-23Resolved in the configured zone.
Day of month41-31, L, W, ?L and W support last-day and weekday-relative patterns.
Month51-12, JAN-DECNames are clearer in application configuration.
Day of week60-7, MON-SUN, L, #0 and 7 both mean Sunday; # selects an occurrence within a month.

Copyable schedule examples

Every five minutes at second 0

0 */5 * * * *

Weekdays at 09:00

0 0 9 * * MON-FRI

Last day of every month at midnight

0 0 0 L * *

First Monday of every month at midnight

0 0 0 ? * MON#1

Spring macro for the top of every hour

@hourly

Disable a cron trigger supplied through configuration

-

Spring Boot @Scheduled example

Enable scheduling once in configuration, put the schedule in external configuration, and set zone explicitly when the requirement is a local wall-clock time.

@Configuration
@EnableScheduling
class SchedulingConfig {}

@Component
class ReportJobs {

  @Scheduled(
      cron = "${jobs.report.cron:0 0 9 * * MON-FRI}",
      zone = "${jobs.report.zone:UTC}")
  public void buildWeekdayReport() {
    // Make the operation idempotent and observable.
  }
}

Deployment checklist

  1. Enable scheduling once with @EnableScheduling or the equivalent Boot configuration.
  2. Externalize cron and zone values so operations can change timing without editing Java code.
  3. Test the expression with Spring CronExpression rather than a generic Unix-only validator.
  4. Decide how multiple replicas coordinate and alert on missing successful completion.

Zone selection and DST

The @Scheduled zone attribute controls the timezone used to resolve the cron expression. Leave it empty and Spring uses the scheduler’s default timezone, which can differ between laptops, containers, and production hosts.

Use an IANA zone such as Europe/Istanbul for a business-hour schedule that should follow regional rules, or UTC for a stable infrastructure cadence. Avoid short abbreviations such as EST because they are ambiguous and do not express the complete rule history.

A local time near a daylight-saving transition can be missing or repeated. Preview transition dates, make the method idempotent, and do not put a non-repeatable billing operation inside an ambiguous clock window.

@Scheduled(
    cron = "0 30 9 * * MON-FRI",
    zone = "Europe/Istanbul")

Limits and platform behavior

Six fields only
Spring requires seconds but does not accept Quartz’s optional year field. Count fields before copying an expression from another scheduler.
No-argument scheduled methods
Scheduled methods are invoked by the container and cannot require method arguments. Keep input acquisition inside the job boundary.
Application lifecycle
The trigger exists only while the Spring application and its scheduler are running. It is not an external durable scheduling service.
Replica multiplication
Each application instance can run the same scheduled method. Horizontal scaling can multiply executions unless the job is coordinated.

Production gotchas

  • Calling Spring “Quartz-compatible”

    The formats overlap, but weekday numbering and the year field differ. Validate with the exact Spring version used by the application.

  • Hidden timezone default

    A schedule without zone inherits runtime configuration. Pin the zone whenever wall-clock meaning matters.

  • Long-running or overlapping work

    Repeated @Scheduled declarations are independent, and executor configuration changes concurrency behavior. Use a lock and test tasks that can outlive their interval.

  • Proxy and bean duplication

    Register a scheduled bean once. Duplicate application contexts or bean instances can register the same work more than once.

Frequently asked questions

How many fields does a Spring cron expression have?

Spring cron uses six fields: second, minute, hour, day of month, month, and day of week. There is no year field.

Is Spring cron the same as Quartz cron?

No. Spring supports several Quartz-style modifiers, but it has six fields with no year and uses 0 or 7 for Sunday. Quartz commonly uses 1 for Sunday and may include a year.

How do I set a timezone on @Scheduled?

Set the zone attribute to an IANA timezone, for example @Scheduled(cron = "0 0 9 * * MON-FRI", zone = "Europe/Istanbul").

Can I disable a Spring cron schedule from configuration?

Yes. Spring defines the special cron value - as a disabled trigger, which is useful as an external configuration value.

Official documentation and related guides