What Is a Cron Expression? Cron Expression Parser – Linux Crontab & Quartz, Next Run Times, Timezone
What is a Cron Expression?
A cron expression is a compact schedule string that tells a scheduler exactly when to run a task. In practice, engineers use cron job expressions for backups, ETL, notifications, report generation, and CI/CD automation.
Linux cron uses 5 fields, while Quartz/Spring cron uses 6-7 fields with second-level precision. If you are comparing cron vs quartz, this parser helps you validate both formats and preview the exact next run times in your target timezone.
How This Parser Works
Enter any cron expression and instantly see when it will execute. The parser supports both traditional Linux cron (5-field) and extended Quartz/Spring (6-7 field) formats, with full timezone awareness.
Key Features:
- Dual Format Support: Parse Linux cron (5 fields) or Quartz/Spring (6-7 fields) expressions
- Quick Presets: One-click common schedules like hourly, daily, weekly, monthly
- Expression Builder: Build cron expressions visually by selecting each field
- Visual Schedule Preview: See the next N execution times (0–100, configurable) in individual cards
- 400+ Timezones: Calculate execution times in any timezone worldwide
- Output Format: Display execution times as Human Readable, ISO-8601, Unix Timestamp, or RFC 2822
- Human-Readable Output: Get plain English descriptions of your schedules
- Real-time Validation: Instant feedback on syntax errors with helpful hints
- Copy All Executions: Copy the full list of next execution times to clipboard with one button
Cron Format Reference
Linux Cron (5 Fields)
┌───────────── minute (0-59)│ ┌─────────── hour (0-23)│ │ ┌───────── day of month (1-31)│ │ │ ┌─────── month (1-12)│ │ │ │ ┌───── day of week (0-6, Sun=0)│ │ │ │ │* * * * *Used by: Linux/Unix cron, crontab, most CI/CD systems
Quartz/Spring Cron (6-7 Fields)
┌───────────── second (0-59)│ ┌─────────── minute (0-59)│ │ ┌───────── hour (0-23)│ │ │ ┌─────── day of month (1-31) or ?│ │ │ │ ┌───── month (1-12)│ │ │ │ │ ┌─── day of week (1-7, Sun=1) or ?│ │ │ │ │ │ ┌─ year (optional)│ │ │ │ │ │ │0 0 0 * * ?Used by: Spring Framework, Quartz Scheduler, Java applications
Special Characters
| Symbol | Meaning | Example |
|---|---|---|
* | Every value | * * * * * = every minute |
, | List separator | 1,15 * * * * = minute 1 and 15 |
- | Range | 0 9-17 * * * = hours 9-17 |
/ | Step/interval | */15 * * * * = every 15 min |
? | No specific value (Quartz only) | 0 0 0 ? * MON = every Monday |
Common Use Cases
1. 🔄 System Administration
Automate backups, log rotation, and maintenance tasks. Set up reliable schedules for critical operations without manual intervention.
Examples:
0 2 * * *- Daily backup at 2 AM0 0 * * 0- Weekly cleanup on Sunday midnight*/5 * * * *- Health check every 5 minutes
2. 📊 Data Processing & ETL
Schedule data pipelines, batch processing jobs, and report generation. Coordinate complex workflows across distributed systems.
Examples:
0 1 * * *- Nightly ETL job at 1 AM0 0 1 * *- Monthly report on the 1st0 */4 * * *- Data sync every 4 hours
3. 🚀 CI/CD & DevOps
Trigger automated builds, deployments, and infrastructure updates. Schedule maintenance windows and monitoring tasks.
Examples:
0 0 * * 1-5- Deploy on weekdays at midnight0 6,18 * * *- Build at 6 AM and 6 PM30 23 * * 5- Friday night maintenance
4. 📧 Notifications & Alerts
Schedule email digests, notifications, and reminder systems. Keep stakeholders informed with timely updates.
Examples:
0 9 * * 1- Monday morning digest0 8,12,18 * * *- Reminders at 8, 12, and 60 0 1 1 *- New Year greeting
Linux vs Quartz: Key Differences
| Feature | Linux Cron | Quartz/Spring |
|---|---|---|
| Fields | 5 (no seconds) | 6-7 (with seconds) |
| Day of Week | 0-6 (Sun=0) | 1-7 (Sun=1) or SUN-SAT |
| ? Character | Not supported | Supported (no value) |
| Year Field | Not supported | Optional 7th field |
| Minimum Interval | 1 minute | 1 second |
Frequently Asked Questions
Q: What is a cron expression?
A: A cron expression is a schedule expression that defines when a recurring job runs. Linux cron format has 5 fields (minute hour day month weekday). Quartz/Spring format has 6-7 fields and includes seconds.
Q: Cron vs Quartz - what is the difference?
A: Linux cron uses 5 fields and typically supports minute-level scheduling. Quartz/Spring uses 6-7 fields, supports seconds and ?, and uses different day-of-week conventions. Always validate expressions in the target scheduler format.
Q: Why do my scheduled tasks run at unexpected times?
A: The most common cause is timezone confusion. Cron typically runs in the server's local timezone. Use this tool to verify execution times in your target timezone. Also check if your server uses UTC.
Q: What's the difference between * and ? in Quartz?
A: The * means "every value" while ? means "no specific value" and is only valid in day-of-month and day-of-week fields. In Quartz, you must use ? in one of these fields when specifying the other.
Q: How do I run a job at the last day of the month?
A: Standard cron doesn't support "last day" directly. Common workarounds include running on days 28-31 with a script check, or using schedulers with L support (like Quartz's 0 0 0 L * ?).
Q: Can I schedule tasks more frequently than every minute?
A: Linux cron's minimum granularity is 1 minute. For sub-minute scheduling, use Quartz (supports seconds) or alternative schedulers like systemd timers with OnUnitActiveSec.
Q: Why isn't my weekend-only job working?
A: Check your day-of-week numbering. Linux uses 0-6 (Sunday=0), while Quartz uses 1-7 (Sunday=1). Use 0,6 for weekends in Linux or 1,7 (or SUN,SAT) in Quartz.
Pro Tips
- Always Test First: Use this tool to verify your expression shows the expected execution times before deployment
- Pick Your Format: Use Unix Timestamp or ISO-8601 output when feeding results into scripts, logs, or APIs
- Use Comments: In crontab files, add comments above each entry explaining what the job does
- Log Everything: Redirect output to log files for debugging: */5 * * * * /script.sh >> /var/log/cron.log 2>&1
- Consider Overlap: If jobs run longer than their interval, implement locking to prevent concurrent runs
- DST Awareness: Be careful with schedules around 2-3 AM when DST changes occur
- Use Ranges Wisely: 0 9-17 * * 1-5 is cleaner than listing every hour and weekday
- Stagger Jobs: Don't schedule everything at :00 - spread load with different minutes
Related Tools
- Unix Timestamp Converter - Convert Unix epoch seconds to readable dates and back. ISO 8601 & RFC formats, millisecond-aware input, 400+ IANA timezones, DST-aware. Runs locally in your browser.
- Time Calculator - Add or subtract hours, days, and more from any date; copy Unix epoch seconds (timestamp). Time difference between two datetimes, work hours with break deduction. 400+ timezones, DST-aware.
- Log Timestamp Sorter - Paste log lines, auto-detect ISO-8601, Unix epoch, and RFC 2822 timestamps, normalize to UTC or local time, sort chronologically, and export. Great for debugging distributed systems—client-side only.
- Elapsed Time Calculator - Compute the duration between two datetimes in years, months, weeks, days, hours, minutes, and seconds. Supports timezones and DST-aware calculations for planning and log analysis.