Skip to content
CalculatorAtlas

Time Duration Calculator

Tested

Time between two times.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

The duration between two clock times is the end time minus the start time. If the end is earlier than the start the span is taken to cross midnight, so 22:00 to 06:00 is 8 hours. Enter a start and an end time to see the duration in hours and minutes, as decimal hours and as total minutes.

Equal start and end times give zero. The calculator works on times of day only; to count across several days use a date difference calculator.

Related tools: Days Between Dates Calculator: Number of days, weeks and months between two dates. Hours Calculator: Hours worked between a start and end time, minus breaks. Date Calculator: Add or subtract days, weeks, months or years from a date.

How to use the Time Duration Calculator

  1. Type start time, for example HH:MM (24-hour).
  2. Type end time, for example HH:MM (24-hour).
  3. Press Calculate to see the result, and use Reset to start again.
Inputs of the Time Duration Calculator
InputWhat to enterAllowed values
Start timeText, such as HH:MM (24-hour)—
End timeText, such as HH:MM (24-hour)—

Formula and method

Formula

duration = (end − start) mod 24 h

Exact integer day arithmetic in UTC; no daylight-saving or time-zone effects.

If the end time is earlier than the start, the span crosses midnight. Equal times give 0.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Start time = 09:00; End time = 17:30.

Results of example 1
ResultValue
Duration8 h 30 min
Decimal hours8.5
Total minutes510

Example 2

Inputs: Start time = 22:00; End time = 06:00.

Results of example 2
ResultValue
Duration8 h 0 min
Decimal hours8
Total minutes480

Example 3

Inputs: Start time = 12:00; End time = 12:00.

Results of example 3
ResultValue
Duration0 h 0 min
Decimal hours0
Total minutes0

The first line is the headline result (duration). Below it the time Duration Calculator lists decimal hours and total minutes, which describe the same case from other angles. Exact integer day arithmetic in UTC; no daylight-saving or time-zone effects.

Worked example

From 09:00 to 17:30 is 8 hours 30 minutes, which is 8.5 decimal hours and 510 minutes. The decimal figure is the one to use for pay: 30 minutes is 0.5 hour.

Different end times from a 09:00 start

Every figure in this table comes from running this calculator, so it matches what the form returns.

The 08:00 row crosses midnight, so the span runs to the next morning.

Different end times from a 09:00 start
End timeDurationDecimal hoursTotal minutes
12:003 h 0 min3180
17:308 h 30 min8.5510
23:0014 h 0 min14840
08:0023 h 0 min231380

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Start time: entering "25:00" shows "Enter a time as HH:MM (00:00–23:59)." beside that field and no result.
  • End time: entering "9am" shows "Enter a time as HH:MM (00:00–23:59)." beside that field and no result.

Choosing between the Time Duration Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Time Duration Calculator and similar calculators
CalculatorYou enterIt returns
[Days Between Dates Calculator](/date-calendar/days-between-dates-calculator/)start date, end date and count end date?Days between
[Hours Calculator](/time/hours-calculator/)start time and end timeHours worked
[Date Calculator](/date-calendar/date-calculator/)start date and operationResulting date
[Time Card Calculator](/time/time-card-calculator/)start times, end times and unpaid break per dayTotal time
[Time Until Calculator](/time/time-until-calculator/)current time and target timeTime remaining

Background: dates and times

Date and time results depend on the conventions a tool uses: whether the end date counts, whether weekends and holidays are skipped, how months of different lengths are handled and whether time zones are applied. This page states its convention, and the worked examples show it.

Dates use the Gregorian calendar and calendar days unless the page says otherwise; check deadlines against the rule in your contract or regulation.

Assumptions and limitations

  • Times in 24-hour HH:MM
  • Spans of 24 hours or more need dates

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for start time and end time to confirm this.

Frequently asked questions

What does the Time Duration Calculator calculate?

Elapsed time between two clock times, including across midnight. It returns Duration, Decimal hours and Total minutes.

What formula does the Time Duration Calculator use?

duration = (end − start) mod 24 h. If the end time is earlier than the start, the span crosses midnight.

What do I need to enter in the time Duration Calculator?

You enter Start time and End time.

How is the result rounded or limited?

Exact integer day arithmetic in UTC; no daylight-saving or time-zone effects. Times in 24-hour HH:MM.

What are the limits of this calculator?

Times in 24-hour HH:MM. Spans of 24 hours or more need dates.

What is an example of a time Duration result?

With start time 09:00 and end time 17:30, the duration is 8 h 30 min.

Sources

  • ISO 8601-1: Date and time, representations for information interchange (calendar dates, ordinal dates and week dates)
  • Gregorian calendar reform, papal bull Inter gravissimas (1582): the leap-year rule used for all dates

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.