FLXCode Time Duration Calculator

FLXCode apps

Appearance

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.

Example Time between

1 day, 10 hours, 30 minutes
  • Days, hours, minutes, seconds1 day, 10 hours, 30 minutes
  • Hours, minutes, seconds34:30:00
  • Decimal hours34.50
  • Total minutes2,070
  • Total seconds124,200
  • 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

  1. From Nov 14, 2026 20:00:00 to Nov 16, 2026 06:30:00
  2. 2 days apart = 172,800 s, plus the time difference -48,600 s = 124,200 s
  3. 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

  1. Choose Between two times for a clock span, or Between two dates and times when the days matter.
  2. Type the start and the end. Use AM / PM or 24 hour times, with seconds if you want them.
  3. Read the span at the top. The rows underneath give hours:minutes:seconds, decimal hours, total minutes and total seconds.
  4. Press Swap start and end to flip them.

Worked examples: two times

StartEndTime betweenDecimal hoursNote
9:15 AM5:45 PM8 hours, 30 minutes8.50A work day
10:00 PM6:30 AM8 hours, 30 minutes8.50Past midnight
11:50 AM1:05 PM1 hour, 15 minutes1.25Lunch meeting
06:0018:0012 hours12.00On a 24 hour clock
8:00:108:00:5545 seconds0.01Seconds count too

Worked examples: dates and times

FromToTime betweenTotal hoursNote
2026-11-14 8:00 PM2026-11-16 6:30 AM1 day, 10 hours, 30 minutes34:30:00A long weekend trip
2026-12-24 6:00 PM2026-12-26 9:00 AM1 day, 15 hours39:00:00Christmas visit
2024-02-28 12:00 PM2024-03-01 12:00 PM2 days48:00:00Across a leap day
2023-02-28 12:00 PM2023-03-01 12:00 PM1 day24:00:00No leap day
2026-01-01 12:00 AM2027-01-01 12:00 AM365 days8,760:00:00A 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

  1. Each time becomes seconds after midnight. 5:45 PM is 17 x 3,600 + 45 x 60 = 63,900.
  2. 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.
  3. With dates, the number of calendar days between them is multiplied by 86,400 and the time difference is added on top.
  4. 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

TaskFormula
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

Share Time Duration Calculator