Skip to content

Main content

Civil Time Millisecond Tie Carry Tool

Round a non-leap civil second to the nearest second using an explicit half-tie policy.

Loading tool…

Description

Round one second and millisecond pair under up or even tie policy.

Timestamp notation distinguishes written precision, quantization and carry into the next larger field. Padding a fraction, rounding it and propagating an end-of-day marker are different operations and do not establish clock accuracy.

Round one second and millisecond pair under up or even tie policy.

When to use this tool

Use Civil Time Millisecond Tie Carry when checking one explicit timestamp precision, rounding or carry convention.

How to use the tool and how it works

  1. Enter second, millisecond, tiePolicy. 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 roundedSecond, carriesMinute. Inspect carriesMinute before interpreting the associated values.

Round one second and millisecond pair under up or even tie policy. Require second 0-59 and millisecond 0-999; round up above 500 or on the selected tie rule, wrapping second 60 to zero and flagging minute carry.1

Input fieldMeaning and unitsAccepted input
secondSecondRequired. Safe integer; minimum 0; maximum 59.
millisecondMillisecondRequired. Safe integer; minimum 0; maximum 999.
tiePolicyup or even at exactly 500 milliseconds; carry is returned separately.Required. Text; one of "up", "even"; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
roundedSecondRounded SecondRequired. Safe integer.
carriesMinuteCarries MinuteRequired. Boolean.
json
{
  "input": {
    "second": 59,
    "millisecond": 500,
    "tiePolicy": "even"
  },
  "output": {
    "roundedSecond": 0,
    "carriesMinute": true
  }
}

Limitations and assumptions

  • The tool returns no minute/date fields; callers must propagate the carry separately.
  • 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

Use complete date-time arithmetic when a carry must change a date or interact with timezone transitions.

References

  1. Calculation and input contract: date/civil-time-millisecond-tie-carry — tool.io

Similar or alternative tools