Skip to content

Main content

Date: Ordinal Date Field Split Tool

Parse a strict Gregorian YYYY-DDD ordinal-date field and validate its leap-aware day-of-year domain.

Loading tool…

Description

Parse a Gregorian ordinal-date token.

Civil calendar arithmetic needs explicit year numbering, leap rules and index origins. A weekday mask or Gregorian component operation does not identify a timezone, working calendar or historical calendar reform.

Parse a Gregorian ordinal-date token.

When to use this tool

Use Date: Ordinal Date Field Split when checking the stated weekday or Gregorian calendar 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 result. Expand result to inspect the returned fields.

Parse a Gregorian ordinal-date token. Require YYYY-DDD, year 1-9999 and day within 365 or 366 according to the Gregorian leap rule; return numeric year and dayOfYear.1

Input fieldMeaning and unitsAccepted input
tokenTokenRequired. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultReturned object; expand its named members below.Required. Object.
result.yearYearCalculated result member: number.
result.dayOfYearDay Of YearCalculated result member: number.
json
{
  "input": {
    "token": "2024-060"
  },
  "output": {
    "result": {
      "year": 2024,
      "dayOfYear": 60
    }
  }
}

Limitations and assumptions

  • This is a restricted token parser, not ISO week-date parsing or a historical calendar conversion.
  • Outputs are nested inside result. 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 an appropriate full calendar library and authoritative local rules when business days, historical dates or real scheduling matter.

References

  1. Calculation and input contract: date/ordinal-date-field-split — tool.io

Similar or alternative tools