Skip to content

Main content

ISO Duration Week Only Token Tool

Compute iso duration week only token from explicit bounded inputs.

Loading tool…

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

  1. Enter token. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
tokenTokenRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
weeksWeeksRequired. Safe integer.
daysDaysRequired. Safe integer.
json
{
  "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

  1. Calculation and input contract: date/iso-duration-week-only-token — tool.io

Similar or alternative tools