Time Duration Calculator

Free time duration calculator. Find the exact duration between two dates and times, with days, hours, minutes, and total hours or minutes.

AI-ready Use this tool with AI

This tool has a free JSON API. Copy a prompt or skill below to use it with ChatGPT, Claude, or any AI agent — no API key needed.

API docs
Enter a start and end time.

How time duration calculator works

A time duration calculator measures the elapsed time between two moments, accounting for the calendar (including leap years and months of different lengths). It is used for billing, project tracking, event countdowns, and shift planning.

This calculator parses a start and end date-time (YYYY-MM-DDTHH:mm) and computes the difference in milliseconds, then breaks it into days, hours, minutes, and seconds. It also reports the total in hours, minutes, and days as decimals, and produces a compact formatted string like "1d 08:30:00". A reversed range yields a negative total.

Pick a start and end using the date-time pickers and click Calculate. The tool handles cross-day, cross-month, and cross-year spans automatically because it works from the underlying timestamps. Use it for timesheets, countdowns, and any "how long until" question.

Frequently asked questions

What format does the input use?
A date and time in YYYY-MM-DDTHH:mm, picked from the date-time picker. Both the start and end must be supplied.
How are days, hours, and minutes computed?
The difference in milliseconds is divided into whole days (86400s), then the remaining hours, minutes, and seconds. So 32.5 hours shows as 1 day, 8 hours, 30 minutes.
What if the end is before the start?
The totals become negative and the formatted string is prefixed with a minus sign, so you can see the direction of the difference.
Does it account for daylight saving?
It uses the timestamps directly, so a span across a DST change may show an hour more or less than clock time. For billing-sensitive spans across DST, confirm against local clock times.