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

  1. Enter days, hours, minutes, seconds. Use the exact text syntax, units and index conventions explained below.
  2. Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
  3. 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 fieldMeaning and representationAccepted input
daysdays.Safe integer
hourshours.Safe integer
minutesminutes.Safe integer
secondsseconds.Safe integer
Output fieldInterpretation
resultObject containing the named outputs below.
result.daysThe days value under the stated formula or text convention.
result.hoursThe hours value under the stated formula or text convention.
result.minutesThe minutes value under the stated formula or text convention.
result.secondsThe seconds value under the stated formula or text convention.
json
{
  "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

  1. Tool behavior and example: Duration Component Normalizer — tool.io

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.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies