Specifications
OCPS 1.0: The Baseline
Status: FINAL
Revision: 3
Date: 2026-09-04
1. Introduction #
This document defines version 1.0 of the Open Cron Pattern Specification (OCPS). This version serves as the foundational baseline for all future versions. Its primary goal is to codify the established Vixie / ISC cron standard, ensuring a stable and universally understood foundation for scheduling.
2. Design Rationale #
The design of OCPS 1.0 is predicated on establishing a stable, universally understood foundation by codifying the Vixie/ISC cron dialect. This approach ensures that a significant corpus of existing cron patterns is immediately compliant, providing a frictionless adoption path.
To maintain a strict focus on the core five-field syntax, features that extend beyond it are intentionally deferred. This includes not only modifiers from other dialects (like Quartz's L, W, ?) but also scheduling aliases (e.g., @daily). While aliases are a common feature of Vixie cron, they are treated as a separate syntactic concept and are introduced in a subsequent version. This keeps the baseline definition clean and focused, with a key objective of providing explicit rules for ambiguous edge cases to ensure all compliant implementations behave identically.
3. Conformance #
An implementation is considered "OCPS 1.0 Compliant" if it correctly parses and evaluates patterns according to all rules specified in this document. Any pattern valid in OCPS 1.0 MUST remain valid and produce an identical schedule in all future versions of the specification.
4. Pattern Format #
4.1. Structure #
An OCPS 1.0 pattern MUST consist of five fields separated by whitespace. A compliant parser MUST adhere to the following rules:
- It MUST reject a pattern containing any characters not explicitly allowed by Section 4.3 by raising a clear parsing error.
- Any leading or trailing whitespace from the entire string MUST be ignored.
- One or more consecutive whitespace characters MUST be treated as a single delimiter.
MINUTE HOUR DAY-OF-MONTH MONTH DAY-OF-WEEK
4.2. Field Values #
| Field | Required | Allowed Values |
|---|---|---|
| Minute | Yes | 0-59 |
| Hour | Yes | 0-23 |
| Day of Month | Yes | 1-31 |
| Month | Yes | 1-12 or JAN-DEC |
| Day of Week | Yes | 0-7 or SUN-SAT |
- Month and Day of Week names MUST be treated as case-insensitive.
- In the Day of Week field,
0and7MUST both be treated as Sunday.
Month Name Equivalents #
| Name | Numeric Value |
|---|---|
| JAN | 1 |
| FEB | 2 |
| MAR | 3 |
| APR | 4 |
| MAY | 5 |
| JUN | 6 |
| JUL | 7 |
| AUG | 8 |
| SEP | 9 |
| OCT | 10 |
| NOV | 11 |
| DEC | 12 |
Day of Week Name Equivalents #
| Name | Numeric Value |
|---|---|
| SUN | 0 or 7 |
| MON | 1 |
| TUE | 2 |
| WED | 3 |
| THU | 4 |
| FRI | 5 |
| SAT | 6 |
4.3. Character Set #
After converting any textual representations (e.g., JAN, SUN) to their numeric equivalents, a pattern MUST only contain characters from the following set:
- Whitespace: Space (
U+0020) or horizontal tab (U+0009). - Digits:
0123456789 - Special Characters:
*,-/
5. Special Characters #
| Character | Name | Example | Description |
|---|---|---|---|
* | Wildcard | * * * * * | Matches every allowed value for the field. |
, | List Separator | 0,15,30,45 | Specifies a list of individual values. |
- | Range | 9-17 | Specifies an inclusive range of values. |
/ | Step | 5-59/15 | Specifies an interval. The step operates on the range it modifies, yielding 5,20,35,50 for this example. |
5.1. Combining Special Characters #
In OCPS 1.0, the special characters are combined within a single field to create complex schedules. The combination follows a specific order of operations.
- List Separation (
,): The comma is the top-level separator. It breaks a field into a list of independent sub-expressions. The final set of values for the field is the union (logicalOR) of the results of each sub-expression. A parser MUST parse and validate every sub-expression in the list, even if an earlier sub-expression already yields the full possible range for the field. - Range (
-) or Wildcard (*): Within each sub-expression, a range (10-20) or a wildcard (*) defines the initial set of numbers. A wildcard is equivalent to the full possible range for that field (e.g.,0-59for minutes). Accordingly, an unrestricted wildcard MAY appear as one entry within a list (e.g.,*,1-30), and if all other entries are valid the resulting set for the field is still the full possible range. - Step (
/): The step is an operator that filters the set generated by a range or wildcard. The resulting set includes the lowest value of the range, plus every N-th value after that (where N is the step value) which also falls within the range.
6. Operational Semantics #
6.1. Logical Combination of Day of Month and Day of Week #
When both the Day of Month and Day of Week fields are restricted, a match occurs if either field matches the current date. This is a logical OR.
For this rule, a field is unrestricted only when its first list sub-expression is *. Any other form is restricted, even if it evaluates to the full field range (e.g., 1-31 in the day-of-month field). This preserves Vixie-compatible day-field behavior while still allowing * inside lists (e.g., *,1 is unrestricted).
- Example: The pattern
0 12 1 * MONwill trigger at noon on the first day of every month, AND at noon on every Monday.
6.2. Error Handling and Edge Cases #
Out-of-Range Values #
A parser MUST reject a pattern if any numeric value falls outside the allowed range for its field (e.g., 60 in the minute field, 32 in the day-of-month field). This MUST be treated as a parsing error. This requirement applies to every list sub-expression independently; for example, *,*,61 in the minute field is a parsing error even though * already covers the full range.
Invalid Ranges #
A range A-B where A is greater than B is invalid. A parser MUST treat this as a parsing error.
Invalid Step Syntax #
A parser MUST reject the following step-related patterns as parsing errors:
- A step value of
0(e.g.,*/0), as it has no logical definition. - A step operator not preceded by
*or a full rangeA-B(e.g.,/30,0/15, or10/10). The/character MUST be preceded by either*or a range in the formA-Bwhere both A and B are specified (e.g.,*/30or10-50/10are valid, but/30,0/15, or10/10are not).
Impossible Date Combinations #
A pattern containing a valid but impossible date (e.g., * * 31 2 * for February 31st) MUST be considered syntactically valid and MUST NOT cause a parsing error.
Implementations that provide iterators to find the next or previous occurrences of a schedule (e.g., findNextRun()) SHOULD throw a runtime error or otherwise indicate that no valid run time can ever be found for such a pattern.
6.3. Implementation-Specific Configurations #
To allow for flexibility while maintaining a stable standard, the following rules apply to implementation-specific configurations:
- An implementation MAY provide configuration options that alter the default behaviors defined in this specification.
- Compliance with this specification MUST be evaluated based on the implementation's default, unconfigured behavior.
6.4. Time Zone Handling #
OCPS 1.0 patterns are timezone-agnostic.
A compliant parser or scheduler MUST interpret the pattern against the implementation's local time. The mechanism for defining this local time is an implementation detail, as per Section 6.3.
Appendix A: Revision History #
| Revision | Date | Author(s) | Description of Changes |
|---|---|---|---|
| 3 | 2026-09-04 | The OCPS Authors | Clarified list expressions containing wildcard sub-expressions: unrestricted * remains valid inside a list and is equivalent to the full field range, parsers MUST still validate every list sub-expression and reject invalid trailing entries such as *,*,61, and day-field OR semantics remain Vixie-compatible by treating only a leading unrestricted wildcard (*) as unrestricted for Section 6.1. |
| 2 | 2026-06-07 | The OCPS Authors | Clarified step notation syntax requirements: step operator (/) must be preceded by either wildcard (*) or range (A-B). Added explicit parsing error for invalid syntax like /30. |
| 1 | 2025-10-28 | The OCPS Authors | Initial publication of the 1.0 specification. |