Time Tools
Duration Calculator
Work out the time between two dates in days, hours, and minutes, with calendar months, totals, and working days.
Understand the format
How Duration Calculator works
There are two right answers to "how long between these dates", and mixing them up is where billing, SLA, and holiday calculations go wrong.
Elapsed time and calendar days are different questions
Ask how long from 31 January to 31 March and there are two defensible answers. A calendar says 59 days. A stopwatch says 58 days and 23 hours, because the clocks went forward an hour in between. Neither is a bug: one measures the wall calendar, the other measures physical time.
This page reports both, and tells you when they disagree. Which one you want depends on the question. Billing by the hour and measuring an SLA want elapsed time. Booking leave, counting notice periods, and working out an age want calendar days, because people count mornings, not seconds.
Months and years are not fixed lengths
A month is between 28 and 31 days, and a year is 365 or 366. That makes "one month" meaningless as a duration in seconds: one month from 31 January is 28 February in most years, and adding thirty days gives 2 March instead. Any code that treats a month as 30 days will produce dates that drift.
The calendar breakdown here counts the way a person does, taking whole months first and then the remaining days. That is why it can report "2 months, 0 days" for a range whose elapsed time is not a round number of hours.
Working days need a definition before they need a formula
The working-day count here is whole Monday-to-Friday days in the range. It knows nothing about public holidays, which vary by country, region, and sometimes by employer, and nothing about a working week that runs Sunday to Thursday, as it does in much of the Middle East.
That is a deliberate limit rather than an oversight. A working-day figure is only meaningful against a stated calendar, so use this as a starting point and subtract the holidays that apply to the people involved.
Step by step
How to use Duration Calculator
- Set the start date and time, then the end.
- Read the headline for elapsed time, then the calendar breakdown beneath it.
- Compare the calendar days with the elapsed days if a daylight saving warning appears.
- Use the working-day count as a starting point, then subtract public holidays yourself.
The calculation runs in your browser using the Date and Intl APIs. The dates you enter are not transmitted or stored.
Troubleshooting
Common mistakes and how to fix them
- Treating a month as 30 days in code.
- Add calendar months with a date library instead. One month after 31 January is 28 February, not 2 March.
- Dividing an elapsed millisecond count by 86,400,000 to get days.
- That is correct for physical time but wrong for calendar days across a clock change. Pick the figure that matches your question.
- Quoting working days without saying whose calendar.
- Public holidays differ by country and region, and the weekend is not Saturday and Sunday everywhere.
- Comparing two dates from different time zones without converting.
- Convert both to the same zone, or to UTC, before subtracting.