Date difference guide

How to Calculate Time Between Two Dates

To calculate the time between two dates, subtract the start date and time from the end date and time. The result can be shown as total seconds, minutes, hours, days, weeks, months, or years.

Try a date difference calculator

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

Use exact start and end values

Always include both the date and the time if precision matters. The difference between January 1 at 09:00 and January 2 at 09:00 is exactly 24 hours, but January 1 at 09:00 to January 2 at 17:30 is 32 hours and 30 minutes.

Convert the difference into units

After subtracting the two timestamps, convert the result into the unit you need. Divide by 60 for minutes, 3600 for hours, and 86400 for days.

Calendar breakdowns are different

A calendar breakdown, such as 1 year and 3 days, is not the same as a fixed number of seconds divided by an average year. Leap years and month length can change the result, so use calendar-aware calculations when dates matter.