Cron Expression
Cron expression generator & parser
秒分时日周年
Usage Guide
A Cron expression is a string consisting of 6 or 7 space-separated fields, each representing a time unit.
Field Meanings
| # | Field | Values | Special Chars |
|---|---|---|---|
| 1 | Second | 0-59 | , - * / |
| 2 | Minute | 0-59 | , - * / |
| 3 | Hour | 0-23 | , - * / |
| 4 | Day of Month | 1-31 | , - * / ? L W C |
| 5 | Month | 1-12 or JAN-DEC | , - * / |
| 6 | Day of Week | 1-7 or SUN-SAT | , - * / ? L C # |
| 7 | Year | 1970-2099 | , - * / |
Special Character Descriptions
- * - Matches any value in the field
- ? - Used only in day-of-month and day-of-week fields, means no specific value
- - - Specifies a range
- , - Specifies multiple values
- / - Specifies increments
- L - Last, used only in day-of-month and day-of-week fields
- W - Weekday, used only in day-of-month field
- # - Nth occurrence of a weekday, used only in day-of-week field
Common Expression Examples
0 0 12 * * ?- Fire at 12:00 PM every day0 15 10 ? * *- Fire at 10:15 AM every day0 15 10 * * ?- Fire at 10:15 AM every day0 15 10 * * ? *- Fire at 10:15 AM every day0 15 10 * * ? 2026- Fire at 10:15 AM every day in 20260 * 14 * * ?- Fire every minute from 2:00 PM to 2:59 PM every day0 0/5 14 * * ?- Fire every 5 minutes from 2:00 PM to 2:55 PM every day0 0/5 14,18 * * ?- Fire every 5 minutes from 2:00 PM to 2:55 PM and 6:00 PM to 6:55 PM every day