Duration Calculator
Runs in your browserHow long between two moments, what a date becomes after adding time to it, and what PT1H30M actually means.
The “Now” buttons work once the page has finished loading.
How this one works
The difference between two dates is given two ways, because both are useful and they disagree. The sentence at the top counts calendar units — years, months and days as a person would say them, which is how Java's Period and Python's relativedelta count. The totals below count elapsed time, which is what a deadline or a bill runs on.
Adding a duration follows the same split: months and days move the calendar (so one month after 31 January is 28 February, and a day later is the same time tomorrow even if the clocks changed overnight), while hours, minutes and seconds are added as exact elapsed time.
Business days count whole Monday to Friday days in the range. Public holidays are not included — they differ by country, and guessing them would be worse than leaving them to you.
Questions
- Why do the calendar figure and the total days disagree?
- Because months are not a fixed length. From 31 January to 1 March is "1 month and 1 day" on the calendar, but 29 total days in 2026. Neither is wrong — use the calendar reading for how people talk about it, and the totals for arithmetic.
- What duration formats are understood?
- ISO 8601 (P1Y2M3DT4H5M6S, and P2W for weeks), Java's Duration.toString() including its negative component form (PT-6H-30M), and plain text such as "1d 2h 30m", "90 minutes" or "2 years 6 months".
- Does daylight saving affect the result?
- Yes, and it is handled. The two dates are turned into instants in the zone you choose, so a range that crosses a clock change has 23 or 25 hours in that day. If a date you pick falls in an hour that never happens, the tool says so.
- Are leap years and leap seconds handled?
- Leap years, yes — February 2028 has 29 days here. Leap seconds, no: Unix time ignores them, so every minute is 60 seconds, the same assumption your database and language make.