Skip to content

Main content

Hydrology: Water Year Day Index Tool

Compute a one-based hydrologic-year day from an explicit annually valid month/day start; excludes February29 annual starts and jurisdiction defaults.

Loading tool…

Description

Validate a real Gregorian date and annual start month/day, rejecting February 29 as an annual start.

A water year is a calendar interval beginning on a declared annual date. Its day index is a calendar-day count from that origin and differs from a jurisdiction-specific label or elapsed local hours.

Validate a real Gregorian date and annual start month/day, rejecting February 29 as an annual start.

When to use this tool

Use Hydrology: Water Year Day Index when you need a one-based day coordinate for an explicitly chosen annual water-year start.

How to use the tool and how it works

  1. Enter date, startMonth, startDay. 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.

Validate a real Gregorian date and annual start month/day, rejecting February 29 as an annual start. Choose the latest start not after date and return elapsed UTC-midnight days plus one as dayIndex, together with waterYearStart inside result.1

Input fieldMeaning and unitsAccepted input
dateReal Gregorian YYYY-MM-DD in years 0001-9999.Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
startMonthAnnual start month, 1-12.Required. Safe integer.
startDayAnnual start day; must be valid in a nonleap year, excluding February 29.Required. Safe integer.
Output fieldInterpretationReturned shape
resultObject containing the calculated members; expand it to inspect individual values.Required. Object.
result.waterYearStartLatest supplied annual start not after date, in YYYY-MM-DD.Calculated result member: string.
result.dayIndexOne-based calendar-day count; the start date is day one.Calculated result member: number.
json
{
  "input": {
    "date": "2024-01-01",
    "startMonth": 10,
    "startDay": 1
  },
  "output": {
    "result": {
      "waterYearStart": "2023-10-01",
      "dayIndex": 93
    }
  }
}

Limitations and assumptions

  • Dates and computed start must remain in years 0001-9999. No jurisdictional water-year start is selected, and calendar days are not elapsed local hours; the start day has index one.
  • 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.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Confirm the source agency's water-year convention and retain the actual start date when exchanging records.

References

  1. Calculation and input contract: hydrology/water-year-day-index — tool.io

Similar or alternative tools