Quartz:Cron Expressions
原文地址:http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontrigger.html
注意:
位也可能是7位,最后1位的年可以省略。
位和第6位使用问号解决每月的那几天和每周的那几天的冲突问题。加了问号表示该位不起作用。
Format
A cron expression is a string comprised of 6 or 7 fields separated by white space. Fields can contain any of the allowed values, along with various combinations of the allowed special characters for that field. The fields are as follows:
Field Name |
Mandatory |
Allowed Values |
Allowed Special Characters |
Seconds |
YES |
0-59 |
, - * / |
Minutes |
YES |
0-59 |
, - * / |
Hours |
YES |
0-23 |
, - * / |
Day of month |
YES |
1-31 |
, - * ? / L W |
Month |
YES |
1-12 or JAN-DEC |
, - * / |
Day of week |
YES |
1-7 or SUN-SAT |
, - * ? / L # |
Year |
NO |
empty, 1970-2099 |
, - * / |
Examples
Here are some full examples:
Expression |
Meaning |
0 0 12 * * ? |
Fire at 12pm (noon) every day |
0 15 10 ? * * |
Fire at 10:15am every day |
0 15 10 * * ? |
Fire at 10:15am every day |
0 15 10 * * ? * |
Fire at 10:15am every day |
0 15 10 * * ? |
2005 Fire at 10:15am every day during the year 2005 |
0 * 14 * * ? |
Fire every minute starting at 2pm and ending at 2:59pm, every day |
0 0/5 14 * * ? |
Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day |
0 0/5 14,18 * * ? |
Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day |
0 0-5 14 * * ? |
Fire every minute starting at 2pm and ending at 2:05pm, every day |
0 10,44 14 ? 3 WED |
Fire at 2:10pm and at 2:44pm every Wednesday in the month of March. |
0 15 10 ? * MON-FRI |
Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday |
0 15 10 15 * ? |
Fire at 10:15am on the 15th day of every month |
0 15 10 L * ? |
Fire at 10:15am on the last day of every month |
0 15 10 L-2 * ? |
Fire at 10:15am on the 2nd-to-last last day of every month |
0 15 10 ? * 6L |
Fire at 10:15am on the last Friday of every month |
0 15 10 ? * 6L |
Fire at 10:15am on the last Friday of every month |
0 15 10 ? * 6L 2002-2005 |
Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005 |
0 15 10 ? * 6#3 |
Fire at 10:15am on the third Friday of every month |
0 0 12 1/5 * ? |
Fire at 12pm (noon) every 5 days every month, starting on the first day of the month. |
0 11 11 11 11 ? |
Fire every November 11th at 11:11am. |
Quartz:Cron Expressions的更多相关文章
- 【Cron Expressions】Quartz Scheduler 2.1.x 英文节选
Cron Expressions Cron-Expressions are used to configure instances ofCronTrigger. Cron-Expressions ar ...
- Cron Expressions——Cron 表达式(QuartZ调度时间配置)
如果你需要像日历那样按日程来触发任务,而不是像SimpleTrigger 那样每隔特定的间隔时间触发,CronTriggers通常比SimpleTrigger更有用. 使用CronTrigger,你可 ...
- Quartz(一):Cron表达式
正文 1. 表达式介绍 Cron:cron表达式用于配置cronTrigger的实例.cron表达式实际上是由七个子表达式组成.这些表达式之间用空格分隔. Cron格式:[秒] [分] [小时] [日 ...
- Quartz中Cron表达式使用方法
Quartz中CronTrigger支持日历相关的反复时间间隔(比方每月第一个周一运行),而不是简单的周期时间间隔. 它的调度规则基于 Cron 表达式. 以下就来说一下Cron表达式的规则及使用方法 ...
- Date与Quartz的cron之间的相互转换
1.概述 最近在写一个Quartz相关的模块,需要实现Date与Quartz的cron之间的相互转换,在网上查了一下竟然没有找到,但是找到一份这样的博客:http://hw1287789687.ite ...
- Quartz 用 cron 表达式存放执行计划
Quartz 用 cron 表达式存放执行计划.引用了 cron 表达式的 CronTrigger 在计划的时间里会与 job 关联上. 1.Quartz cron 表达式支持七个域如下: 名称 是否 ...
- android switch语句报错:case expressions must be constant expressions
今天无意中碰见了 case expressions must be constant expressions 的问题 写了一个 switch(item.getItemId()) { case R. ...
- linux分享四:cron系统
cron相关文件: /etc/cron.monthly/ /etc/cron.weekly/ /etc/cron.daily/ /etc/cron.hourly/ /etc/cron.d/ /etc/ ...
- AS报错:lambda expressions are not supported at this language level
AS报错:lambda expressions are not supported at this language level 解决方法 打开打开 File --> Project Stuct ...
随机推荐
- Weiphp随笔,百度天气API接口
新建插件名必须大写 http://api.map.baidu.com/telematics/v3/weather?location=%E5%8C%97%E4%BA%AC&output=json ...
- python wraps
用代码说明问题: def d(f): def _d(*args, **kwargs): print f.__name__, ' is called' f(*args, **kwargs) return ...
- UOJ 做题记录
UOJ 做题记录 其实我这么弱> >根本不会做题呢> > #21. [UR #1]缩进优化 其实想想还是一道非常丝播的题目呢> > 直接对于每个缩进长度统计一遍就好 ...
- C语言宏定义时#(井号)和##(双井号)的用法1
#在英语里面叫做 pound 在C语言的宏定义中,一个#表示字符串化:两个#代表concatenate 举例如下: #include <iostream> void quit_comman ...
- C# 数组、多维数组(矩形数组)、锯齿数组(交叉数组)
数组是变量的索引列表,可以在方括号中指定索引来访问数组中的各个成员,其中索引是一个整数,从0开始. 一维数组 多维数组(矩形数组) 数组的数组(锯齿数组) 数组必须在访问之前初始化,数组的初始化有两种 ...
- [转载]Python-第三方库requests详解
Requests 是用Python语言编写,基于 urllib,采用 Apache2 Licensed 开源协议的 HTTP 库.它比 urllib 更加方便,可以节约我们大量的工作,完全满足 HTT ...
- C#之new修饰符
转自MSDN:https://msdn.microsoft.com/zh-cn/library/435f1dw2.aspx new隐藏基类成员 在用作修饰符时,new关键字可以显式的隐藏从基类继承的 ...
- centos7安装docker并设置开机启动
版本要求:查看内核版本,需大于3.10 [root@localhost ~]# uname -r -.el7.x86_64 更新内核:如果是生产机器务必慎重更新内核,避免出现不必要的问题. sudo ...
- NSIS脚本入门和进阶方法
NSIS(Nullsoft Scriptable Install System)是一个开源的 Windows 系统下安装程序制作程序.它提供了安装.卸载.系统设置.文件解压缩等功能.对于新手来说,它有 ...
- Angular中使用Rainbow
在使用js类库和框架的时候,大家都习惯于编写自己的使用示例,如果能将示例中的html,js和css 进行展示, 并进行高亮显示,效果会很棒,例如在html高亮显示jquery代码 上面的示例是使用ra ...