Skip to content

Time Interval Calculator - Calculate Time Between Dates

Find the exact time between two dates and times, in seconds, minutes, hours, and days, with a plain-language summary. Accounts for leap years and DST changes.

Time Interval Calculator

Loading calculator...
📚

Documentation

What is a time interval calculator

A time interval calculator finds the exact amount of time between two dates and times. It takes a start date and time and an end date and time, and it reports the difference in seconds, minutes, hours, and days, along with a plain-language summary such as "3 days, 4 hours, 12 minutes."

How to calculate a time interval

Formula

The calculator subtracts the start time from the end time:

Time interval = End time − Start time

A computer cannot subtract "March 15" from "May 20" directly, because a calendar date is not a single number. So the calculator first converts each date and time into a timestamp: a count of milliseconds since a fixed reference point, January 1, 1970, 00:00:00 UTC. Once both dates are timestamps, the subtraction is ordinary arithmetic, and it stays correct across month boundaries, year boundaries, and leap years.

After finding the difference in milliseconds, the calculator converts it into other units:

  • Seconds = milliseconds ÷ 1,000
  • Minutes = seconds ÷ 60
  • Hours = minutes ÷ 60
  • Days = hours ÷ 24

Worked example

Start: May 20, 2023, 10:00 End: May 21, 2023, 11:00

The gap between these is 25 hours. Converted into every unit the calculator shows:

  • 90,000 seconds
  • 1,500 minutes
  • 25 hours
  • 25 ÷ 24 ≈ 1.04 days

The plain-language summary reads "1 day, 1 hour." That summary is built differently from the decimal figures above: the calculator takes the whole number of days first (1), then the hours left over after that (1), then any leftover minutes and seconds (0 and 0). It does not round the decimal day value, it works down through whole units instead.

Leap years and daylight saving time

A calendar year is not always 365 days, and a calendar day is not always 24 hours. Because the calculator works from timestamps rather than counting calendar squares, both cases are handled without special rules.

Leap years. Every four years, February gains an extra day, February 29, to keep the calendar aligned with Earth's orbit around the sun. Century years are the exception: they are leap years only if divisible by 400, so 2000 was a leap year but 1900 was not. Counting from February 28, 2024, 00:00, to March 1, 2024, 00:00, gives 2 days, because 2024 is a leap year and the count passes through February 29.

Daylight saving time. In places that observe daylight saving time, clocks skip an hour in spring and repeat an hour in autumn. On March 10, 2024, clocks in the US Eastern time zone jumped from 2:00 a.m. straight to 3:00 a.m. Someone in that time zone measuring from 1:00 a.m. to 4:00 a.m. that day gets 2 hours, not 3, because the 2 o'clock hour never occurred on the clock. The calculator gets this right because it subtracts timestamps, and a timestamp does not skip or repeat just because a clock does.

Time zones

The start and end fields both use the time zone of the device entering them. When both dates describe times in the same zone, which is the normal case, the result is correct no matter which zone that is, because the zone's offset cancels out during subtraction. If the two dates describe times in different zones, convert one to match the other before entering it. Otherwise the result will be off by the gap between the two zones.

Frequently asked questions

What units does the calculator show?

Seconds, minutes, hours, and days, plus a plain-language summary. Weeks, months, and years are not shown directly, because months and years do not have a fixed length: a month runs 28 to 31 days, and a year runs 365 or 366 days. For an estimate, divide the day count by 7 for weeks, by about 30.44 for an average month, or by about 365.25 for an average year.

Does it account for leap years?

Yes. Because the calculator works from timestamps, leap days are already included in the result without any extra step.

Does it account for daylight saving time?

Yes. It reports the true elapsed time rather than a plain difference between clock digits, so results stay accurate across a daylight-saving change.

Can the end date be before the start date?

No. The end date and time must be on or after the start date and time, or the calculator shows an error instead of a result.

Can it calculate someone's exact age?

Yes. Enter the birth date and time as the start and the current date and time as the end. For example, someone born March 15, 1985, at 3:20 p.m. and measured on November 12, 2024, at 10:45 a.m. is 14,486 days old, or about 39.66 years.

Does the result include weekends and holidays?

Yes, the total counts every calendar day. To estimate weekdays only, take the total number of days, divide by 7 to get whole weeks, multiply that by 5, then add whichever remaining days fall on a weekday.