Spring timer expression org. springframework. Scheduling. Quartz. crontriggerbean.

Source: Internet
Author: User

A quartz crontrigger expression is divided into seven subexpressions, each of which is separated by a space, from left to right: Second, minute, hour, month, month, or day of the week, year. The year is not required. That is to say, each expression requires at least six items!
Example: 0 0 12? * Wed indicates that wed is executed at 12 o'clock every Wednesday. There is no "year" here!

Field name (item) must be a special character in the value range
Seconds are 0-59 ,-*/
0-59 ,-*/
0-23 ,-*/
The day of the month is 1-31 ,-*? /L w
The month is 1-12 or JAN-DEC ,-*/
The day of the week is 1-7 or sun-Sat ,-*? /L #
Year no empty, 1970-2099 ,-*/

 

first look at the display column: "0 0/30 8-10 5, 20 *? "Indicates", and on the 5th and 20th of each month "
character explanation:
,: And, table type ", "The values on both sides are the execution time. For example," 5, 20 "indicates the 5 and 20 days of each month.
-: indicates the range of values. For example, "8-10" in the preceding example ends from to, including and.
*: Any valid value in the table. In the preceding example, "*" is a field in the month, so it represents any value from 1 to 12. Therefore, the preceding example is "every month ".
/: Increment. In the preceding example, the value is obtained every 30 minutes starting from 0. If it is changed to "5/8", the value will be taken every 8 minutes starting from 5th: 8: 13, 8: 29, and so on.
?: No value is specified, that is, "I don't know". It can only appear in "one day of the month, one day of the week. Under what circumstances? For example, if the value is specified as Monday, the system may encounter a conflict if April 5 is not Monday. Therefore, it is specified "? ", That is to say, I do not know the day of the week, as long as it is the 5 and 20 days, so I don't care about the day of the week!
L: Last, last indicates that it can only appear in the "day of month, day of week. Indicates the last day of the current month or the current week. Note that the last day of the week is Saturday.
W: the common day (from Monday to Friday) closest to the specified date in a month can only appear on the "day of the month ", for example, "15 W" means the common day closest to the 15 th day of the current month. If the 15 th day of the current month is Wednesday, and the 15 th day of the current month is Saturday, it is yesterday or Friday, if the 15 day of the month is the day of the week, it is the second day, that is, Monday.
#: the nth day of the week X of the current month can only appear in the "day of the week. For example, "6 #3" means the third Friday of the current month. Note: "1-7", 1 = Sunday, 2 = Monday, and so on.

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.