在线生成Cron表达式,可视化配置定时任务
Configure seconds, minutes, hours, day, month, weekday, and year to generate a Quartz-style Cron expression in real time.
Day-of-month and day-of-week cannot both use specific values. When one is specified, the other is switched to ? automatically.
Click a preset to fill the form with a common Quartz Cron pattern.
* * * ? * 2,6 **Seconds uses the wildcard *.
*Minutes uses the wildcard *.
*Hours uses the wildcard *.
?Day-of-month is not specified and is controlled by day-of-week.
*Months uses the wildcard *.
2,6Runs on Monday, Friday.
*Years uses the wildcard *.
This tool outputs a 7-part Quartz Cron in the order: second minute hour day month weekday year.
The weekday field uses 1-7, mapped from Sunday to Saturday.
If your runtime only supports 5-part Cron, remove the seconds and year fields and verify the syntax again.
当您需要在Linux系统、Java Spring框架或其他支持Cron的系统中配置定时任务时,手动编写Cron表达式容易出错且难以理解。本工具通过直观的可视化界面,让您只需选择分钟、小时、日期等参数,即可自动生成标准的Cron表达式,确保定时任务配置的准确性和易读性。
生成的Cron表达式需根据实际调度系统验证;不同系统对Cron的支持略有差异(如Quartz支持秒字段);避免设置过于频繁的任务影响系统性能;本工具生成结果仅供参考,实际使用时请测试验证。
Cron表达式标准格式为“分 时 日 月 星期”,每个字段的取值范围不同:分钟(0-59)、小时(0-23)、日(1-31)、月(1-12)、星期(0-7,其中0和7都代表周日)。特殊字符包括:*(所有值)、,(值列表)、-(范围)、/(步长)。对于需要秒级精度的任务,可使用“秒 分 时 日 月 星期 年”的七字段格式。建议为生产环境任务添加日志记录,并考虑使用锁机制防止重复执行。