Description
Parse a bounded week-only duration token.
Date labels and intervals depend on origins, endpoint inclusion and calendar versus elapsed-time conventions. Numeric serial periods and local token formats can represent useful bookkeeping without resolving a real instant or official fiscal rule.
Parse a bounded week-only duration token.
When to use this tool
Use ISO Duration Week Only Token when checking a supplied date-label, duration or interval convention.
How to use the tool and how it works
- Enter token. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read weeks, days. Use the output convention below.
Parse a bounded week-only duration token. Require P, canonical decimal weeks with up to seven digits, then W; return weeks and days = weeks*7.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| token | Token | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| weeks | Weeks | Required. Safe integer. |
| days | Days | Required. Safe integer. |
{
"input": {
"token": "P3W"
},
"output": {
"weeks": 3,
"days": 21
}
} Limitations and assumptions
- This is a fixed week-count representation, not a full ISO duration or calendar-relative addition.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use a complete date/time implementation and the applicable calendar policy for actual scheduling and interval interpretation.
References
Similar or alternative tools
- ISO Duration Fractional Component Token
Split one duration component's written fields.
- Fiscal Week Extra Day Remainder
Split a nonnegative day count into whole fiscal weeks and remainder.