Duration Component Normalizer
Normalize signed fixed-day duration components by floor division into a signed day count plus nonnegative subday components.
Description
Normalize signed fixed-day duration components by floor division into a signed day count plus nonnegative subday components.
Normalizing signed duration components benefits from a floor-based day count and nonnegative remainder within the day.
When to use this tool
Normalize signed fixed-day duration components by floor division into a signed day count plus nonnegative subday components.
- Prepare the supplied days, hours, minutes, seconds fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter days, hours, minutes, seconds. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.days, result.hours, result.minutes, result.seconds. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Convert bounded integer days/hours/minutes/seconds to total seconds. Use floor(total/86400) for days and nonnegative modulo for the remaining hour, minute and second components.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| days | days. | Safe integer |
| hours | hours. | Safe integer |
| minutes | minutes. | Safe integer |
| seconds | seconds. | Safe integer |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.days | The days value under the stated formula or text convention. |
| result.hours | The hours value under the stated formula or text convention. |
| result.minutes | The minutes value under the stated formula or text convention. |
| result.seconds | The seconds value under the stated formula or text convention. |
{
"input": {
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": -1
},
"output": {
"result": {
"days": -1,
"hours": 23,
"minutes": 59,
"seconds": 59
}
}
} Limitations and assumptions
- A day is exactly 86,400 seconds. The output can express minus one second as minus one day plus 23:59:59; no calendar or daylight-saving arithmetic occurs.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- Lists are limited to 128 entries. JSON text must meet bounded size and depth checks, and numeric outputs beyond the safe finite magnitude are rejected. Exact large integers use decimal strings.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Keep elapsed durations, circular clocks, calendar months and epoch offsets distinct. Use a date/time method with explicit timezone and timescale rules for dated instants; arithmetic on one representation does not supply the others.
References
Similar or alternative tools
- Clock Window Union Duration
Merge overlapping civil clock windows after overnight splitting and count covered seconds once on the fixed day.
- Duration Countdown State
Classify an explicit countdown observation, retaining signed lateness; does not read a clock or schedule anything.