文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > Quartz Expression
侵权投诉

Quartz Expression

Java Quartz Expression

A "Cron-Expression" is a string comprised of 6 or 7 fields separated by white space. The 6 mandatory and 1 optional fields are as follows:

Field Name

Seconds

Minutes

Hours

Day-of-month

Month

Day-of-Week Allowed Values 0-59 0-59 0-23 1-31 Allowed Special Characters , - * / , - * / , - * / , - * ? / L W C 1-12 or JAN-DEC , - * / 1-7 or SUN-SAT , - * ? / L C #

Year (Optional) empty, 1970-2099 , - * /

The '*' character is used to specify all values. For example, "*" in the minute field means "every minute".

The '?' character is allowed for the day-of-month and day-of-week fields. It is used to specify 'no specific value'. This is useful when you need to specify something in one of the two fileds, but not the other. See the examples below for clarification.

The '-' character is used to specify ranges For example "10-12" in the hour field means "the hours 10, 11 and 12".

The ',' character is used to specify additional values. For example "MON,WED,FRI" in the day-of-week field means "the days Monday, Wednesday, and Friday".

The '/' character is used to specify increments. For example "0/15" in the seconds field means "the seconds 0, 15, 30, and 45". And "5/15" in the seconds field means "the seconds 5, 20, 35, and 50". You can also specify '/' after the '*' character - in this case '*' is equivalent to having '0' before the '/'.

The 'L' character is allowed for the day-of-month and day-of-week fields. This character is short-hand for "last", but it has different meaning in each of the two fields. For example, the value "L" in the day-of-month field means "the last day of the month" - day 31 for January, day 28 for February on non-leap years. If used in the day-of-week field by itself, it simply means "7" or "SAT". But if used in the day-of-week field after another value, it means "the last xxx day of the month" - for example "6L" means "the last friday of the month". When using the 'L' option, it is important not to specify lists, or ranges of values, as you'll get confusing results.

The 'W' character is allowed for the day-of-month field. This character is used to specify the weekday (Monday-Friday) nearest the given day. As an example, if you were to specify "15W" as the value for the day-of-month field, the meaning is: "the nearest weekday to the 15th of the month". So if the 15th is a Saturday, the trigger will fire on Friday the 14th. If the 15th is a Sunday, the trigger will fire on Monday the 16th. If the 15th is a Tuesday, then it will fire on Tuesday the 15th. However if you specify "1W" as the value for day-of-month, and the 1st is a Saturday, the trigger will fire on Monday the 3rd, as it will not 'jump' over the boundary of a month's days. The 'W' character can only be specified when the day-of-month is a single day, not a range or list of days.

The 'L' and 'W' characters can also be combined for the day-of-month expression to yield 'LW', which translates to "last weekday of the month".

The '#' character is allowed for the day-of-week field. This character is used to specify "the nth" XXX day of the month. For example, the value of "6#3" in the day-of-week field means the third

第1页

你可能喜欢

热门文档

相关文档

  • quartz中cronExpression配置说明

    quartz中cronExpression配置说明_IT/计算机_专业资料。quartz中cronExpression配置说明quartz 中 cronExpression 配置说明 字段 允许值 秒 0-59 分 0-59 小时 0-23...

  • Quartz在Spring中动态设置cronExpression

    class="org.springframework.scheduling.quartz.CronTriggerBean" > <property name="jobDetail" ref="schedulerJobDetail"/> <property name="cronExpression"> <...

  • Spring--quartz中cronExpression配置说明

    Spring--quartz中cronExpression配置说明_IT/计算机_专业资料。Spring--quartz中cronExpression配置的相关说明,如每天的什么时候自动运行...

  • Spring中Quartz任务调度器cronexpression配置说明

    Spring中Quartz任务调度器cronexpression配置说明_计算机软件及应用_IT/计算机_专业资料。Spring中Quartz任务调度器cronexpression配置说明...

  • Quartz_学习笔记

    <property name="cronExpression"> 31. <value>0 0 */1 * * ?</value> 32. </property> 33.</bean> 34. Job: org.quartz.Job 是一个接口,只定义...

  • quartz中CronExpression配置详解

    quartz中CronExpression配置详解_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 quartz中CronExpression配置详解_IT/计算机_专业资料。一个Cron-表达式是一...

  • Quartz在Spring中动态设置cronExpression (spring设置...

    Quartz在Spring中动态设置cronExpression (spring设置动态定时任务)_IT/计算机_专业资料。spring quartzQuartz在Spring中动态设置cronExpression (spring设置动态定时任务)...

  • Spring Quartz定时器 的动态调度

    ="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="testQuartzJob" /> <property name="cronExpression"> <value>0...

  • Quartz的使用说明

    </cron-expression> </cron> </trigger> </job> </quartz> 上面配置了一个作业, Name; CronTrigger,每三秒 上面配置了一个作业,并声明一个参数 Name;配置了...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email