Skip to article
TOOLS. SYSTEMS. BETTER DECISIONS.
Stack & Method

The journal

Does a cron expression have 5 or 6 fields?

The short answer and how to tell which format your scheduler expects, with a worked conversion example and a quick checklist.

Minimalist editorial diagram of three side by side cron format strips as stacked colored boxes on a pale background illustrating 5 field 6 field and 7 field layouts

Both exist. Traditional Unix-style crontab uses five fields. Many application schedulers use six fields by adding a leading seconds field, and some add a seventh optional year field. Always match the field count and order documented by your scheduler.

Evidence: a Unix-style five-field format is documented with minute, hour, day-of-month, month, day-of-week only, with no seconds or year fields, in product docs that build on standard cron syntax DataKitchen: Cron Expression Basics. By contrast, Quartz-style cron expressions explicitly require six fields (seconds through day-of-week) and allow an optional seventh year field Quartz CronExpression reference. A modern overview also notes that cron expressions may be five, six, or seven fields depending on implementation DssW: Modern Cron.

What each format looks like

Five-field (classic Unix-style)

Order: minute, hour, day-of-month, month, day-of-week. Example: 30 2 * * 1 means 02:30 every Monday. See examples and ranges in DataKitchen: Cron Expression Basics.

Six-field (adds seconds)

Order: seconds, minute, hour, day-of-month, month, day-of-week. Example: 0 30 2 * * * means 02:30:00 every day. Quartz documents six required fields beginning with seconds Quartz CronExpression reference.

Seven-field (adds seconds and year)

Order: seconds, minute, hour, day-of-month, month, day-of-week, year. Example: 0 15 10 * * ? 2026 fires 10:15:00 every day in 2026 (illustrated in vendor docs that mirror Quartz-style rules) Elixir Scheduler: Cron Expression.

Tip: The special tokens ?, L, W, and # are part of Quartz-style syntax; they are not valid in classic five-field crontab. See operators in Quartz CronExpression reference.

Illustration style diagram of five field Unix crontab layout with labels minute hour day of month month day of week and example cron line

How to decide which one your scheduler expects

  1. Read the scheduler’s own reference and copy its example order and operators. DssW’s overview explicitly notes five-, six-, and seven-field variants across implementations DssW: Modern Cron.
  2. Check for seconds support. If the docs show a leading seconds field, it is not five-field.
  3. Check for a year field. If present, it will be the seventh field at the end.
  4. Verify operators. If you see ? in examples, you are likely in a Quartz-style parser; classic five-field cron does not use ? Quartz CronExpression reference.
  5. Preview next run times in the actual system if it offers a validator.

If you are new to scheduling reliability, our broader explainer on workflow failure points covers overlap, retries and monitoring: What are the most common failure points in automated workflows?

A worked conversion example (5 to 6 or 7 fields)

Goal: Convert a five-field entry that runs 02:30 every Monday to formats that require seconds (and optionally year).

  • Five-field original (Unix-style): 30 2 * * 1 → 02:30 every Monday DataKitchen: Cron Expression Basics
  • Six-field target (seconds added at the front): 0 30 2 * * 1
  • Seven-field target (seconds + year): 0 30 2 * * 1 * if the parser allows any year; to restrict to 2026: 0 30 2 * * 1 2026 (year field per Quartz CronExpression reference)

Quartz-style day field rule: if you use its operators, one of day-of-month or day-of-week is typically set to ?. For example, "10:15 every day in 2026" is expressed as 0 15 10 * * ? 2026 in Quartz-like docs Elixir Scheduler: Cron Expression.

Common portability traps

Minimalist 2D vector diagram comparing a six field string with leading seconds and a seven field Quartz style string including trailing year showing aligned field positions

Quick checks before you deploy a cron schedule

FAQ

So is it 5 or 6 fields?

Classic Unix-style crontab is five fields. Quartz-style schedulers use six required fields (with seconds) and may include an optional seventh year field. Check your product’s reference: DataKitchen for five-field, and Quartz for six/seven-field.

Can the same expression work everywhere?

No. Field order, allowed operators and day-of-week numbering differ. Compare against the target documentation and test in place. A neutral overview of five-, six-, and seven-field variants is in DssW: Modern Cron.

Related reading: building resilient automations often needs idempotent work and overlap control. See What are the most common failure points in automated workflows? and What is an idempotency key in APIs?

Stack & Method logo

Sources and further reading

Your privacy choices

Optional analytics helps us improve these guides. It stays off until you allow it. Privacy details