CronScheduleBuilder.cronSchedule("0 0 12 ? * WED");
Cron表達式總共有7個位置分別是
Seconds
Minutes
Hours
Day-of-Month
Month
Day-of-Week
Year (optional field)
表達 | seconds | minutes | hours | dayofmonth | month | dayofweek | year |
---|---|---|---|---|---|---|---|
每周三12點執行 | 0 | 0 | 12 | ? | * | WED |
1.每個位置可以是范圍,可以是列表,也可以是混搭
“MON-FRI”, “MON,WED,FRI”, or “MON-WED,SAT”.
2.*表示所有可能的月份
java query,3.數字指代時間
0 to 59 for seconds and minutes
0 to 23 for hours
Day-of-Month can be any value 1-31
Months can be specified as values between 0 and 11, or by using the strings JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV and DEC.
Days-of-Week can be specified as values between 1 and 7 (1 = Sunday) or by using the strings SUN, MON, TUE, WED, THU, FRI and SAT.
4./
‘0/15’ means ‘every 15th minute of the hour, starting at minute zero’
‘3/20’ ‘every 20th minute of the hour, starting at minute three’ 等價于 ‘3,23,43’
5.在weekday和monthday中二選一,?表示不選的一方
6.L
代表last
java delayqueue、在monthday中
L 表示月中最后一天
L-3 表示月中倒數第三天
在weekday中
L 表示星期中最后一天
L-3 表示星期中倒數第三天
6L 表示每個月最后一個周五
7#
“6#3"或"FRI#3” 表示每月第三個周五
參考:
http://www.quartz-scheduler.org/documentation/2.4.0-SNAPSHOT/tutorials/tutorial-lesson-06.html
http://www.quartz-scheduler.org/api/2.3.0/org/quartz/CronScheduleBuilder.html
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态