Time Duration Calculator
Give a start and an end. See the time between them in days, hours, minutes and seconds, in total minutes and in decimal hours.
https://flxcode.com/time-duration-calculator/
Example Time between
- Days, hours, minutes, seconds
- Hours, minutes, seconds
- Decimal hours
- Total minutes
- Total seconds
- Both times are read as clock times on a calendar, with no time zone and no daylight saving change. For two places, use the time zone converter.
How it was worked out
- From Nov 14, 2026 20:00:00 to Nov 16, 2026 06:30:00
- 2 days apart = 172,800 s, plus the time difference -48,600 s = 124,200 s
- 124,200 s = 34:30:00
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
Quick start
- Choose Between two times for a clock span, or Between two dates and times when the days matter.
- Type the start and the end. Use AM / PM or 24 hour times, with seconds if you want them.
- Read the span at the top. The rows underneath give hours:minutes:seconds, decimal hours, total minutes and total seconds.
- Press Swap start and end to flip them.
Worked examples: two times
| Start | End | Time between | Decimal hours | Note |
|---|---|---|---|---|
| 9:15 AM | 5:45 PM | 8 hours, 30 minutes | 8.50 | A work day |
| 10:00 PM | 6:30 AM | 8 hours, 30 minutes | 8.50 | Past midnight |
| 11:50 AM | 1:05 PM | 1 hour, 15 minutes | 1.25 | Lunch meeting |
| 06:00 | 18:00 | 12 hours | 12.00 | On a 24 hour clock |
| 8:00:10 | 8:00:55 | 45 seconds | 0.01 | Seconds count too |
Worked examples: dates and times
| From | To | Time between | Total hours | Note |
|---|---|---|---|---|
| 2026-11-14 8:00 PM | 2026-11-16 6:30 AM | 1 day, 10 hours, 30 minutes | 34:30:00 | A long weekend trip |
| 2026-12-24 6:00 PM | 2026-12-26 9:00 AM | 1 day, 15 hours | 39:00:00 | Christmas visit |
| 2024-02-28 12:00 PM | 2024-03-01 12:00 PM | 2 days | 48:00:00 | Across a leap day |
| 2023-02-28 12:00 PM | 2023-03-01 12:00 PM | 1 day | 24:00:00 | No leap day |
| 2026-01-01 12:00 AM | 2027-01-01 12:00 AM | 365 days | 8,760:00:00 | A whole year |
The leap day rows differ by one day because 2024 has a Feb 29. The days come from the same calendar engine as the Days Between Dates page.
How the span is worked out
- Each time becomes seconds after midnight. 5:45 PM is 17 x 3,600 + 45 x 60 = 63,900.
- With two times, the start is taken from the end. If that is negative, 86,400 seconds (one day) is added, because the span crosses midnight.
- With dates, the number of calendar days between them is multiplied by 86,400 and the time difference is added on top.
- The total seconds are written as days, hours, minutes and seconds, and divided by 3,600 for decimal hours.
Clock changes: the clock gap is not always the real gap
This tool measures the difference of two clock readings. On the day the US clocks go forward, 2026-03-08 in New York, 1:00 AM to 4:00 AM reads as 3:00:00 on the clock. The real time that passes is 2:00:00, because the hour from 2:00 to 3:00 AM does not exist. The same happens in reverse when the clocks go back. The Time Zone Converter works with real moments, so convert both times there to see the true gap.
Numbers this uses
- 60 seconds in a minute, 60 minutes in an hour, 86,400 seconds in a day.
- Same start and end time in the times only mode is 0, not 24 hours.
- Decimal hours: 2 decimals, rounded half up.
- Dates from year 1 to 9999 on the Gregorian calendar.
- On the AM / PM clock, a time typed without AM or PM is guessed: the start as AM, the end as the first reading later than the start. A note says what it picked.
In Excel or Google Sheets
| Task | Formula |
|---|---|
| Gap between times in A1 and B1 | =B1-A1, cell format [h]:mm |
| Shift that may pass midnight | =MOD(B1-A1,1) |
| Decimal hours | =(B1-A1)*24 |
| Minutes | =(B1-A1)*1440 |
Limits
- No time zones and no daylight saving in the result. Both times must be on the same clock.
- To add a duration to a time instead, use the Time Calculator. To total a week of shifts with breaks, use the Hours Calculator.
Nothing you type is uploaded. We count events without cookies (details).
FAQ
How do I calculate the time between two times?
Subtract the earlier time from the later one. 5:45 PM minus 9:15 AM is 8 hours 30 minutes. Both times become seconds after midnight, the start is taken from the end, and the answer goes back to hours, minutes and seconds.
What happens if the end time is earlier than the start time?
In the times only mode, the tool assumes the span crosses midnight and adds 24 hours, so 10:00 PM to 6:30 AM is 8 hours 30 minutes. It tells you it did. If you mean something else, use the dates and times mode and give both dates.
How do I find the time between two dates with times?
Switch to dates and times. Type both dates and both times. The day difference comes from the calendar, the times are added on top, and the result is shown in days, hours, minutes and seconds. Nov 14 at 8:00 PM to Nov 16 at 6:30 AM is 1 day 10 hours 30 minutes.
How do I get the answer as decimal hours?
It is shown under the main result. Minutes are divided by 60 and the value is rounded to 2 decimals, half up. 8 hours 30 minutes is 8.50 and 1 day 10 hours 30 minutes is 34.50 hours.
Does it count daylight saving or time zones?
No. It measures the difference between two clock readings. On the night the clocks change, the real elapsed time can be an hour more or less. For two places, or to see the real gap across a clock change, use the time zone converter and compare the two moments.
Can I use it for a flight time?
Only if both times are in the same zone. A flight that leaves New York at 10:00 PM and lands in London at 10:00 AM is 7 hours in the air, not 12, because London is 5 hours ahead in winter. Convert one of the times first.
How do I do this in Excel or Google Sheets?
With start in A1 and end in B1 as times, =B1-A1 gives the gap, formatted as [h]:mm. For a shift past midnight use =MOD(B1-A1,1). For decimal hours use =(B1-A1)*24. With full dates and times in the cells, =B1-A1 already counts the days.
Is what I type uploaded or saved?
No. The calculation runs in your browser, and nothing you type is stored, put in the address bar or counted. We only count that a result was calculated and in which mode.
More from FLXCode
Time CalculatorNew
Add and subtract hours, minutes and seconds, or add a duration to a time of day to get the end time.
Hours CalculatorNew
Add up hours worked in a week from start and end times and breaks. Get h:mm and decimal hours for a timesheet.
Days Between DatesNew
Count the days, weeks, months and business days between two dates, with or without the end date.
Date CalculatorNew
Add or subtract days, weeks, months and years from a date, or only business days. Shows the weekday and the steps.