Duration Countdown State
Classify an explicit countdown observation, retaining signed lateness; does not read a clock or schedule anything.
Description
Classify an explicit countdown observation, retaining signed lateness; does not read a clock or schedule anything.
A countdown can preserve signed overdue time while showing a nonnegative remaining amount.
When to use this tool
Classify an explicit countdown observation, retaining signed lateness; does not read a clock or schedule anything.
- Prepare the supplied deadline, now 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 deadline, now. 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.signedRemaining, result.remaining, result.state. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Subtract now from deadline. Return signedRemaining, max(0,signedRemaining) and pending, due or expired according as the signed value is positive, zero or negative.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| deadline | deadline. | Finite number |
| now | now. | Finite number |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.signedRemaining | The signed remaining value under the stated formula or text convention. |
| result.remaining | The remaining value under the stated formula or text convention. |
| result.state | The state value under the stated formula or text convention. |
{
"input": {
"deadline": 10,
"now": 12
},
"output": {
"result": {
"signedRemaining": -2,
"remaining": 0,
"state": "expired"
}
}
} Limitations and assumptions
- Values must share a time unit and reference. No system clock, timer or timezone conversion is used.
- 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 Component Normalizer
Normalize signed fixed-day duration components by floor division into a signed day count plus nonnegative subday components.