Quartz cron expression reference

Source: Internet
Author: User

Croz cron expression Quartz is a class library for scheduled tasks. Cron expressions are powerful and simple expressions used to develop scheduled tasks.A cron expression has at least six (or seven) time elements separated by spaces. In order Second ( 0 ~ 59 )Minute (0 ~ 59) hour (0 ~ 23) days (months) (0 ~ 31, but you need to consider the number of days of your month) month (0 ~ 11) Day (week) (1 ~ 7 1 = sun, Mon, Tue, wed, Thu, Fri, SAT) 7. Year (1970-2099)

Each element can be a value (such as 6), a continuous interval (9-12), and an interval (8-18/4) (/indicates every 4 hours ), A list (1, 3, 5) with wildcards. Because the two elements "date in the month" and "date in the week" are mutually exclusive, one of them must be set ?. 0 0 10, 14, 16 **? Ten o'clock A.M., two o'clock P.M., every day
0 0/30 9-17 **? Every 30 minutes in 9 to 5 working hours
0 0 12? * Wed indicates that some subexpressions can contain some scopes or lists at every Wednesday, for example, subexpressions (Day (week)) Can be "MON-FRI", "mon, wed, Fri", "MON-WED, sat" "*" character represents all possible values. Therefore, "*" in the subexpression (Month) Indicates the meaning of each month, "*" in the subexpression (Day (week)) Indicates the increment of the number of "/" characters for each day of the week. For example, in the subexpression (minute), "0/15" indicates that it starts from 0th minutes, "3/20" in the subexpression (minute) every 15 minutes indicates that it starts from 3rd minutes and every 20 minutes (it is the same as "3, 23, 43 ").
"?" The character is only used for two subexpressions: Day (month) and day (week), indicating that no value is specified. When one of the two subexpressions is specified, in order to avoid conflict, you need to set the value of another subexpression to "?" The "L" character is only used for two subexpressions: Day (month) and day (week). It is short for the word "last", but it has different meanings in two subexpressions. In the subexpression of "month", "L" indicates the last day of a month in the self expression of "Week". "L" indicates the last day of a week, that is, if the SAT has specific content before "L", it has other meanings. For example, "6l" indicates the last 6th days of the month, "fril" indicates the last Friday of the month. Note: when using the "L" parameter, do not specify the list or range, because this will cause problems.

 

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.