Skip to content
Calcrivo

Time Duration Calculator

Measure the precise duration between two date-times, down to seconds.

Inputs

Enter as YYYY-MM-DDTHH:mm (e.g. 2025-06-15T08:30).

Must be after Start for a positive duration.

Include seconds-level precision in the breakdown.

Duration

08h 30m 00s

Exact span broken into days, hours, minutes and seconds.

Total Days

0.354167

Total Hours

8.5000

Total Minutes

510.00

Total Seconds

30,600

Total Weeks

0.0506

Reversed Range

No

Step by step

  1. Start date-time

    = 2025-01-01T09:00

  2. End date-time

    = 2025-01-01T17:30

  3. Raw difference

    1735752600000 ms − 1735722000000 ms = 30600000 ms

    = 30,600,000 ms

  4. Convert to seconds

    30600000 ÷ 1000

    = 30600.000 s

  5. Decompose into d/h/m/s

    0d + 8h + 30m + 0s

    = 08h 30m 00s

How it works

This calculator measures the exact span between two date-time instants by differencing their UTC millisecond timestamps. That makes it accurate across month and year boundaries (which have unequal lengths) and correct across daylight-saving transitions when both times share the same local timezone. The total-second count is then decomposed into days, hours, minutes and seconds for display.

Formulas

Duration

Duration (ms) = end timestamp − start timestamp

t_{end}
End date-time as Unix milliseconds
t_{start}
Start date-time as Unix milliseconds

Decomposition

days = floor(|Δt_s| / 86400), hours = floor((|Δt_s| mod 86400) / 3600), ...

\Delta t_{s}
Duration in seconds

Frequently Asked Questions

How is this different from the Date Duration Calculator?

The Date Duration Calculator works at day granularity and is designed for 'how many days between two dates' questions. This calculator works at second granularity and is designed for questions like 'how long did this process take' where hours and minutes matter.

What format should I enter date-times in?

Use ISO 8601 format: YYYY-MM-DDTHH:mm, for example 2025-06-15T08:30. Most modern browsers also accept 'June 15, 2025 08:30' but the ISO format is unambiguous.

Is this accurate across daylight-saving time changes?

Yes, because both timestamps are converted to UTC milliseconds before differencing. A 2-hour span from 1:00 AM to 3:00 AM on a spring-forward night will correctly compute as 1 hour of elapsed wall-clock time.

What happens if the start is after the end?

The duration is still computed but shown as negative. This is useful when you need to know 'how far in the past' a timestamp is.

You might also need