Code tool

Time Duration Calculator

Compare two local clock times and choose whether an earlier end wraps to the next day or remains a negative duration.

In-browser processingNo account requiredPrivacy details ↗
Interpretation

Overnight wrap adds 24 hours when the end time is earlier than the start. Signed duration keeps that result negative.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter the start and end clock times.
  2. Choose overnight wrap for a span crossing midnight, or signed duration to preserve a negative result.
  3. Calculate and review the duration in hours and minutes.

Two clear interpretations

Overnight wrap treats an end time earlier than the start as the following day. Signed duration keeps the direct subtraction, so the same example is −21 hours 15 minutes.

Clock times only

This calculator accepts local 24-hour clock times and performs the calculation in your browser. It does not use dates, time zones, daylight-saving rules, or eval.

GOOD TO KNOW

Common questions

What happens when the times are equal?

The duration is zero in either mode.

Can I calculate an overnight span?

Yes. Choose Overnight wrap when the end clock time is earlier than the start.

Why use signed duration?

It makes the direction explicit when you want end minus start without wrapping to another day.