Unix Cron vs Spring and Quartz Cron

Compare five-field Unix Cron with six and seven-field Spring or Quartz expressions, including seconds, question marks and common conversion mistakes.

Field differences

SystemFieldsDaily at 02:00
Unix Cron50 2 * * *
Spring Cron60 0 2 * * *
Quartz Cron6 or 70 0 2 * * ?

Unix begins with minutes. Spring and Quartz begin with seconds. Quartz can also add a year field and supports modifiers such as ?, L, W and #.

Common conversion mistakes

Do not simply prepend 0 without checking semantics. Confirm whether the scheduler permits both day fields, how Sunday is numbered and which modifiers it supports.

For Kubernetes CronJobs, use the standard five-field format. For Spring applications, consult the documentation for your framework version.

Expression conversions

IntentUnix or KubernetesSpringQuartz
Every minute* * * * *0 * * * * *0 * * * * ?
Daily at 02:000 2 * * *0 0 2 * * *0 0 2 * * ?
Weekdays at 09:000 9 * * 1-50 0 9 * * MON-FRI0 0 9 ? * MON-FRI

These examples demonstrate field placement, but the accepted syntax still depends on the implementation and version. Spring supports names such as MON-FRI; Quartz uses ? to mean no specific value in one of the two day fields.

What the special Quartz characters mean

  • ? leaves either day-of-month or day-of-week unspecified.
  • L can mean the last day of a month or week, depending on its field.
  • W selects the nearest weekday to a day of the month.
  • # selects an occurrence such as the second Monday of a month.

These modifiers are not portable to a normal Linux crontab or Kubernetes CronJob. A valid Quartz expression can therefore be invalid elsewhere even when its timing looks simple.

Migration checklist

Identify the scheduler before converting anything. Count the fields, confirm whether seconds and year are supported, check weekday numbering, verify the timezone and preview multiple runs. Tests should cover month boundaries and any expression that combines day-of-month with day-of-week. Keep the original expression beside the converted one during review so a shifted field is easy to spot.

Build a five-field schedule with the Cron generator, then verify the target scheduler before deployment.