No Login Data Private Local Save

Quartz Cron to Unix Cron Converter - Online Format Translator

7
0
0
0

Quartz Cron to Unix Cron Converter

Instantly translate between Quartz Scheduler Cron (6/7 fields) and Unix Crontab (5 fields) expressions. Handles weekday mapping, special characters, and format differences.

Quartz Cron 6 or 7 fields
Sec Min Hour Day Month Week* [Year] Week: 1=SUN
→ Unix
Unix Cron 5 fields
Min Hour Day Month Week* Week: 0=SUN
Quick Examples (click to fill)
Every 5 min Daily noon Weekdays 9AM 1st of month Wed 2:30PM Sunday midnight 1st & 15th 8:15AM Last day 10PM
Format Reference
Field Quartz Cron Unix Cron Notes
Seconds 0–59 — (not present) Quartz has seconds; Unix starts at minutes
Minutes 0–59 0–59 Same in both formats
Hours 0–23 0–23 Same in both formats
Day of Month 1–31 1–31 Quartz supports ?, L, W
Month 1–12 / JAN–DEC 1–12 / JAN–DEC Same in both formats
Day of Week 1–7 (1=SUN) 0–6 (0=SUN) Key difference! Mapping differs by 1
Year [optional] 1970–2099 — (not supported) Quartz optional 7th field; dropped in Unix
Special characters in Quartz not supported by Unix: ? (converted to *), L, W, # — these will trigger a warning on conversion.
Frequently Asked Questions
What is the difference between Quartz Cron and Unix Cron?

Quartz Cron uses 6 or 7 fields: Seconds Minutes Hours Day-of-Month Month Day-of-Week [Year]. It's used by the Quartz Scheduler in Java applications (including Spring Boot). Unix Cron (crontab) uses 5 fields: Minutes Hours Day-of-Month Month Day-of-Week. The key differences are: (1) Quartz has a seconds field; Unix does not. (2) Quartz weekday numbering is 1–7 (1=Sunday); Unix is 0–6 (0=Sunday). (3) Quartz supports extra special characters like ?, L, W, and # that Unix cron does not.

How does the weekday mapping work between Quartz and Unix?

In Quartz, weekdays are numbered 1–7 where 1 = Sunday, 2 = Monday, ..., 7 = Saturday. In Unix cron, weekdays are 0–6 where 0 = Sunday (7 also means Sunday). The mapping formula: Unix = Quartz − 1 (e.g., Quartz 2/Monday → Unix 1/Monday). When using day names (SUN, MON, etc.), they remain the same across both formats since the names are identical.

What happens to the Quartz ? character during conversion?

The ? character in Quartz means "no specific value" and is used in either the Day-of-Month or Day-of-Week field (not both). When converting to Unix cron, ? is replaced with * (every value), since Unix cron doesn't support the ? concept. This preserves the intended behavior in most cases.

Can Unix cron expressions be converted back to Quartz format?

Yes! This tool supports bidirectional conversion. When converting Unix → Quartz, a seconds field of 0 is prepended, and weekday numbers are mapped from Unix (0–6) to Quartz (1–7). Click the swap button () to reverse the direction. However, note that Quartz-specific features (like L, W, #) cannot be recovered from a Unix expression.

What are L, W, and # in Quartz cron?

These are Quartz-specific special characters: L = "Last" (e.g., L in Day-of-Month = last day of month; 5L in Day-of-Week = last Thursday). W = "Weekday" (nearest weekday to the given day, e.g., 15W). # = "Nth weekday" (e.g., 2#3 = 3rd Monday). None of these are supported in Unix cron, so converting them will produce a warning and the characters may be simplified or stripped.

Why does my converted expression not trigger at the exact same time?

In most simple cases, the conversion is exact. However, differences can arise because: (1) Quartz treats Day-of-Month and Day-of-Week as an OR relationship when both are specified (not ? or *), while Unix cron behavior varies by implementation. (2) Quartz's L, W, and # have no Unix equivalent and are simplified. (3) Unix cron's 7 for Sunday is mapped to Quartz 1. Always test your converted expressions in the target environment.

Is the Quartz Year field preserved during conversion?

No. The optional Year field (7th field) in Quartz cron is dropped when converting to Unix, since Unix cron has no year field. When converting Unix → Quartz, no year field is added (the 6-field Quartz format is used). If you need year-specific scheduling, you'll need to handle that at the application level.

What are the valid ranges for each cron field?

Quartz Cron: Seconds 0–59 | Minutes 0–59 | Hours 0–23 | Day-of-Month 1–31 | Month 1–12 or JAN–DEC | Day-of-Week 1–7 or SUN–SAT | Year (optional) 1970–2099.
Unix Cron: Minutes 0–59 | Hours 0–23 | Day-of-Month 1–31 | Month 1–12 or JAN–DEC | Day-of-Week 0–7 or SUN–SAT (0 & 7 both = Sunday). Both formats support *, ,, -, and / special characters.

Can I use month and weekday names (JAN, MON, etc.) in both formats?

Yes! Both Quartz and Unix cron support three-letter abbreviations for months (JAN–DEC) and weekdays (SUN–SAT). The names are case-insensitive in most implementations. This tool preserves name-based values during conversion, which is especially helpful for weekday fields since the numeric mapping differs but the names remain the same across formats.