Quartz Time Configuration Detailed __quartz

Source: Internet
Author: User
Tags ranges

Here are some instructions on Quartz time configuration:

Field Order

 

Allowed Values

 

special characters that are allowed

Seconds

0-59

, - * /

Part

0-59

, - * /

Hours

0-23

, - * /

Date

1-31

, - * ? /L W C

Month

1-12 or Jan-dec.

, - * /

Week

1-7 or Sun-sat.

, - * ? /L C #

Years (optional)

Leave Blank, 1970-2099

, - * /


The ' * ' character is used to specify all values. For example, "*" in the minute field means "every minute".
The "*" character is used to specify all values. For example, "*" means "per minute" in the field area of the 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, and but not the other. The examples below for clarification.
“?” Characters are used only in date fields and week fields. It is used to specify an "ambiguous value". It is useful when you need to specify something by one of these two domains. Look at the example below and you will understand.
Dates in the month and dates in the week these two elements should be mutually exclusive by setting a question mark (?). To indicate that you do not want to set that field

The '-' character is used to specify ranges for example "10-12" in the hour field means "The hours, one and 12".
The "-" character is used to specify a range. such as: "10-12" in the hour field means "10 points, 11 points, 12 points."

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 a different value. such as: "Mon,wed,fri" in the week field, said "Monday, Wednesday, Friday."

The '/' character is used to specify increments. For example "0/15" in the Seconds field means "the seconds 0,,, and 45". and "5/15" in the Seconds field means "the seconds 5, M, and 50". Specifying ' * ' before the '/is equivalent to specifying 0 is the ' the ' the ' the ' the '. Essentially, for each field in the expression, there are a set of numbers that can being turned on or off. For seconds and minutes, the numbers range from 0 to 59. For hours 0 to, for the "month 0 to", and for months 1 to 12. The "/" character simply helps you turn on every "nth" value in the given set. Thus "7/6" in the Month field is turns on month "7", it does not mean every 6th month.

The "/" character is used to specify an incremental value. For example 0/15 appearing in the second field means "0,15,30 and 45 Seconds" (triggered). And 5/15 in the second field means "5,20,35 and 50th Seconds" (triggered). The designation "*/" and "0/" are equivalent.

Note: When the value of the numerator + denominator is greater than the maximum value of the field, if the second field appears when 45/20, which means that after the first 45 seconds of every 20 will trigger once, but 20 seconds later counted as another time period, so the field of the/20 is invalid, if changed to 45/10 is only the 45th and 55 seconds will be performed once.

The ' L ' character is allowed for the Day-of-month and Day-of-week fields. This character was short-hand for ' last ', but it has different meaning in each of the two. For example, the value ' L ' in the Day-of-month field means ' The last day of the month '-day to January, day for Fe Bruary 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" mean S "The last Friday of the month". When using the ' L ' option, it is important not to specify lists, or ranges of values, as and ll get confusing results.

L is the ellipsis of ' last ' to represent Day-of-month and Day-of-week fields, but in two fields the meaning is different, for example, the last day of one months in the Day-of-month field,
If the Day-of-week field represents ' 7 ' or ' SAT ', if preceded by a number in the Day-of-week field, it means the last days of one months, such as ' 6L ', representing the last of the one months
Friday

The ' W ' character is allowed for the Day-of-month field. This character was used to specify the weekday (Monday-friday) nearest the given day. As a example, if you are 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'll fire on Friday the 14th. If the 15th is a Sunday, the trigger'll fire on Monday the 16th. If the 15th is a Tuesday, then it'll 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'll fire on Monday the 3rd, as it won't ' jump ' over the boundary of a month ' s. The ' W ' character can only being specified when the day-of-month was 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 W Eekday of the "month".

The ' # ' character is allowed for the Day-of-week field. This character was 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 Friday of the month (Day 6 = Friday and "#3" = th E 3rd one in the month). Other examples: "2#1" = the "Monday" month and "4#5" = The fifth Wednesday. Note this if you specify "#5" and there are not 5 of the given Day-of-week in the month, then no firing would occur that Mon Th.

The ' C ' character is allowed for the Day-of-month and Day-of-week fields. This character was short-hand for "calendar". This means values are calculated against the associated calendar, if any. If No, the calendar is associated, then it are equivalent to has an all-inclusive calendar. A value of "1C" in the Day-of-week field means "the" the "the" the "the" the "the" the "the" "the" calendar on or after Sunday.

Introduction to Cronexpression:

Special characters allowed by field allowed values
Seconds 0-59,-*/
Cent 0-59,-*/
Hour 0-23,-*/
Date 1-31,-*? /L W C
Month 1-12 or JAN-DEC,-*/
Week 1-7 or Sun-sat,-*? /L C #
Year (optional) leave blank, 1970-2099,-*/
Meaning of expression
"0 0 12 * *" Every day 12 o'clock noon.
"0 15 10?" * * "Every 10:15 trigger
"0 15 10 * *" Every day 10:15 trigger
"0 15 10 * *? * "Every 10:15 trigger
"0 15 10 * *? 2005 "2005 Every day 10:15 triggers
"0 * 14 * *" is triggered every 1 minutes from 2 o'clock in the afternoon to 2:59 every day
"0 0/5 14 * *" is triggered every 5 minutes from 2 o'clock in the afternoon to 2:55 every day
"0 0/5 14,18 * * *" triggered every 5 minutes from 2 o'clock in the afternoon to 2:55 and 6 o'clock in the afternoon to 6:55 every day
"0 0-5 14 * *" is triggered every 1 minutes from 2 o'clock in the afternoon to 2:05 every day
"0 10,44 14?" 3 WED "Every March of Wednesday, 2:10 and 2:44 triggers
"0 15 10?" * Mon-fri "from Monday to Friday 10:15 trigger
"0 15 10 15 *" Every month 15th 10:15 trigger
"0 L *?" triggered 10:15 the last day of every month
"0 15 10?" * 6L "last Friday 10:15 trigger per month
"0 15 10?" * 6L 2002-2005 "2002 to 2005 monthly last Friday 10:15 trigger
"0 15 10?" * 6#3 "The third Friday 10:15 trigger per month
Every morning at 6.
0 6 * * *
Every two hours
0 */2 * * * *
Between 11 o'clock and 7 in the morning, every two hours, eight in the morning.
0 23-7/2,8 * * * *
4th a month and a week on Monday to three in the morning 11.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.