Everyday tool

Time Duration Calculator

Choose a start and end time to calculate the duration between them.

Runs in your browser. No upload.

Start

End

Choose a start and end time.

Total days
—
Total hours
—
Exact duration
—

About this tool

Time Duration Calculator made simple.

For example, 9:15 a.m. to 5:45 p.m. on the same date is 8 hours 30 minutes. Choose both dates as well as both times for an overnight or multi-day interval; breaks are not deducted automatically.

Guide

Using Time Duration Calculator

The Time Duration Calculator measures how much time passes between a start and an end. Each side has a date and a clock time, so the gap can be a few minutes, a night or many days. The result is shown three ways: total days, total hours, and an exact split into days, hours, minutes and seconds. It reads the times as they are on your own device clock. It does not take off breaks, and it cannot add or subtract a time from another one. It only compares two moments.

How to use it

  1. Click the Start box and choose a date and a time. Type the numbers or use the picker.
  2. Click the End box and choose a later date and time. For an overnight job, pick the next calendar date.
  3. Press Calculate duration. Total days, Total hours and Exact duration fill in below.
  4. Read Exact duration for a plain answer such as 3d 6h 30m 0s. Use Total hours when you need a single number.
  5. If a message says to choose valid times, check that both boxes are filled and the end is not before the start.
  6. Press Clear to empty both boxes and the three results.

Worked examples

A working day with half-hour minutes

You enter
Start
2026-05-04T09:15
End
2026-05-04T17:45
You get
Total days
0.354167
Total hours
8.5
Exact
0d 8h 30m 0s

From a quarter past nine to a quarter to six is eight hours and thirty minutes. Written as a decimal, thirty minutes is 0.5 of an hour.

Run through the tool’s own code.

A night that crosses midnight

You enter
Start
2026-05-04T22:00
End
2026-05-05T06:00
You get
Total days
0.333333
Total hours
8
Exact
0d 8h 0m 0s

The end date is the next day, so the tool knows the clock passed midnight. Eight hours is one third of a day.

Run through the tool’s own code.

A span of several days

You enter
Start
2026-06-01T08:00
End
2026-06-04T14:30
You get
Total days
3.270833
Total hours
78.5
Exact
3d 6h 30m 0s

Three full days are 72 hours. Six and a half more hours bring the total to 78.5, and the split shows it as 3 days, 6 hours and 30 minutes.

Run through the tool’s own code.

A whole year of hours

You enter
Start
2026-01-01T00:00
End
2027-01-01T00:00
You get
Total days
365
Total hours
8,760
Exact
365d 0h 0m 0s

The year 2026 is not a leap year, so it has 365 days. Multiplying by 24 gives 8,760 hours, shown with a comma.

Run through the tool’s own code.

Ending before the start

You enter
Start
2026-05-04T17:00
End
2026-05-04T09:00
You get
Message
Choose valid times with the end after the start.

The tool refuses a negative gap. Swap the two boxes if you meant to measure the other direction.

Run through the tool’s own code.

The night the clocks change in Spain

You enter
Start
2026-03-28T12:00
End
2026-03-29T12:00
Device time zone
Europe/Madrid
You get
Total hours
23

On 29 March 2026 clocks in Spain moved forward one hour, so the same clock time one day later is only 23 real hours later. A device in a zone without daylight saving shows 24.

Not run through the tool. Treat it as an illustration.

When it helps

  • Find how long a flight, train ride or drive took from departure to arrival.
  • Measure the length of a work shift that runs past midnight.
  • Check how many hours passed between sending a message and getting a reply.
  • Work out the time left between two events in a project plan.
  • Compare an expected delivery time with the real time it arrived.
  • Count how many hours a rental or parking spot was used.

Limits to keep in mind

  • Breaks, lunch and unpaid time are not removed. Subtract them yourself from the hours shown.
  • The end must not be before the start. An end equal to the start is allowed and shows zero.
  • Times are read in your device time zone. When clocks change for daylight saving, the real gap can be one hour more or less than the clock times suggest.
  • Total days and Total hours are decimals shown to at most six places, so a long fraction such as 0.354167 is rounded.
  • The date and time boxes normally have no seconds field, so the seconds in the exact result are usually 0.
  • The tool measures one gap at a time. It does not add up several shifts or give a total for a week.

Tips

  • Use the Exact duration line to read a result out loud, and the Total hours line to copy into a spreadsheet.
  • To get minutes only, multiply the Total hours by 60 in your head or a calculator.
  • For a shift that crosses midnight, check that the end date is one day later, not the same day.
  • If you plan to pay by the hour, take off unpaid breaks first, then round the way your employer's rules say.
  • When you time an event in another city, convert both times to your own time zone first, because the boxes use your device clock.

Sources

Common questions

About Time Duration Calculator.

How do I calculate the hours between two times?

Choose a start date and time, choose an end date and time, then press Calculate duration. Total hours shows the answer as a number, and Exact duration shows days, hours, minutes and seconds.

How many hours are there from 9:15 a.m. to 5:45 p.m.?

On the same date, the elapsed time is 8 hours 30 minutes, or 8.5 hours. Enter both start and end dates and times to calculate it.

Can the duration cross more than one day?

Yes. Pick an end date that is days later and the tool reports the full gap. For example, June 1 at 8:00 to June 4 at 14:30 is 3 days, 6 hours and 30 minutes.

How do I work out an overnight shift?

Set the end date to the next calendar day. A shift from 22:00 to 06:00 the next morning is 8 hours. Leaving both on the same date would put the end before the start and give an error.

Does it subtract my lunch or breaks?

No. It reports the full elapsed time between the two moments. If you took an unpaid break, subtract it yourself, for example 8.5 hours minus 0.5 hours for a half-hour break gives 8 hours.

Why did I get an error about valid times?

Either a box is empty, or the end is earlier than the start. Fill both boxes and make sure the end is later. The tool does not show a negative duration.

What happens when daylight saving time begins or ends?

The tool uses your device time zone, so a span that crosses a clock change can be an hour shorter or longer than the clock times suggest. In Spain, 28 to 29 March 2026 at noon is 23 hours.

Why is Total days a decimal?

It divides the gap by 24 hours, so a gap shorter than a day shows a fraction, such as 0.333333 for eight hours. Use Exact duration if you want whole days, hours and minutes instead.

Is it the same as a date calculator?

No. A date calculator counts whole calendar days between two dates and ignores the clock. This tool includes the time of day, so it can tell 8 hours from 9 hours on the same date.

Is anything stored or uploaded?

No. Both times are worked out in your browser on your device. Nothing is sent to a server. Pressing Clear empties the boxes and the results.

When should I not trust the result for pay or billing?

Treat it as a quick check, not a payroll record. Your employer or contract may round time, remove breaks or use another time zone. Check those rules before you rely on the number.

How do I calculate hours between two times?

Choose a start date and time, choose an end date and time, then select Calculate duration.

Can I calculate an overnight shift or subtract a break?

Yes, for an overnight shift choose the next calendar date as the end date. The calculator reports elapsed time, but it does not subtract meal breaks or unpaid time.