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
- Enter date, startMonth, startDay. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| date | Real Gregorian YYYY-MM-DD in years 0001-9999. | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| startMonth | Annual start month, 1-12. | Required. Safe integer. |
| startDay | Annual start day; must be valid in a nonleap year, excluding February 29. | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Object containing the calculated members; expand it to inspect individual values. | Required. Object. |
| result.waterYearStart | Latest supplied annual start not after date, in YYYY-MM-DD. | Calculated result member: string. |
| result.dayIndex | One-based calendar-day count; the start date is day one. | Calculated result member: number. |
{
"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
Similar or alternative tools
- Regnal Year Era Token
Return suppliedFirstYear+regnalYear-1 and a JSON-array key retaining source, era, and regnal year.
- Health: Appointment Rem In Der Fixed Offset
Parse a real Gregorian appointmentDate in years 0001-9999, minute of day 0-1439, and earlier offset 0-525600 minutes.