Skip to main content

Clock & duration

Time Duration Calculator

Distinguish wall-clock intervals,explicit-offset elapsed intervals and signed fixed-duration arithmetic.

Formula version
1.0.0
Reviewed
Updated

Calculator

Inputs

Enable JavaScript to calculate. The explanation remains available below.

Results

Enter inputs, then calculate.

How to use

  1. Choose wall-clock comparison, explicit-offset elapsed timestamps or fixed-duration arithmetic.
  2. For wall clocks, select the day offset explicitly. For elapsed timestamps, include each endpoint’s date and UTC offset.

Formula

Clock interval = end clock - start clock + explicit day offset; elapsed interval = end UTC instant - start UTC instant

Wall-clock mode measures the supplied clocks and day offset without a time zone. Elapsed mode uses explicit offsets; fixed durations add or subtract elapsed units without wrapping at 24 hours.

Examples

Worked example

Inputs
Starting clock 22:30; ending clock 06:15; next calendar day selected.
Result
465 minutes; 7 hours45 minutes; 7.75 decimal hours.

Elapsed timestamps and signed arithmetic are distinct

Inputs
Choose fixed-duration subtraction with first duration 30 minutes and second 45 minutes.
Result
Result is negative 15 minutes without wrapping at 24 hours. Explicit-offset elapsed mode instead subtracts instants and rejects a reversed interval.

Limitations

  • No named-zone or historical daylight-saving validation is performed. Equal clocks can represent zero or a next-day interval depending on the explicit input.
  • Resolution is whole milliseconds. Leap seconds and calendar-month or year durations are outside the fixed-day arithmetic.
  • A fixed day means 24 hours, not a calendar-month/year or local-clock transition. Resolution is whole milliseconds; leap seconds and named-zone history are not validated.

Frequently asked questions

Will an earlier ending clock automatically mean the next day?

No. Choose the day offset explicitly so the interval is not inferred from clock ordering.

Can clock difference and elapsed duration disagree?

Yes. Different endpoint UTC offsets can change actual elapsed time even when the local clock difference looks simple.

Sources