Skip to content
ZeroServer.tools

Duration Calculator

Calculate precise differences in dates and times. Subtract break times and customize event inclusivity.

Timeline

Provide input dates to calculate duration.

How time duration is computed

Time spans are calculated by taking differences in UTC epoch millisecond boundaries. The calendar breakdown (years, months, days, hours, minutes, seconds) steps through calendar months to correctly adjust for leap years and differing month lengths.

By adjusting break minutes, the tool decrements total milliseconds to enable precise workplace time card evaluations. Inclusive counting parameters increase the final span by 24 hours to model full workdays.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Getting the exact gap between two date-times in several units.
  • Working out a task's elapsed time from timestamps.
  • Measuring an outage duration precisely enough for an incident report.
  • Calculating a billable period from start and end.
  • Confirming a duration a system reported.

Frequently Asked Questions

Why does 31 January to 28 February show 28 days, not one month?
Because a month has no fixed length. When the day-of-month goes negative the breakdown borrows the length of the previous month, so this span reports 0 months and 28 days. "One month after 31 January" has no unambiguous answer in any calendar system.
What does "include end date" do?
It adds one whole day, which is inclusive counting — how leave, hotel nights and contract days are usually counted. Monday to Friday is 4 days elapsed but 5 working days, and that checkbox is exactly the difference between the two.
Does it handle daylight saving?
The elapsed totals come from absolute timestamps, so a spring-forward day really is 23 hours and an autumn one 25. If a span you think of as "one day" reports 23 hours, that is a genuine clock change, not a rounding error.
Why do the calendar breakdown and the totals disagree?
They answer different questions. Years/months/days uses real, variable month lengths; total days, hours and minutes is pure elapsed time. One year is "1 year, 0 months, 0 days" in the first and 365 or 366 days in the second.
What are the break minutes for?
They are subtracted from the total, for timing work with interruptions — a 9-hour span minus a 60-minute lunch gives 8 hours. The subtraction is floored at zero, so a break longer than the span cannot produce a negative duration.
Why can the same duration be described two ways?
Because months and years vary in length. From 31 January to 1 March is one month and one day, or 29 days — both are correct, and which one a system reports is a convention it has to state.

Common errors and gotchas

  • Mixing time zones between the two inputs, which silently shifts the result.
  • Ignoring a daylight-saving transition, which makes one day 23 or 25 hours.
  • Reading a years-and-months result as exact, when month lengths make it convention-dependent.
  • Reporting a duration in mixed units where the months component depends on the convention used.
  • Assuming the inputs are in the same zone because they look similar.

Related Calculators tools

Private & free — this tool runs entirely in your browser.