Time Duration Calculator Widget
A clock-arithmetic widget for your readers: the span between two clock times (overnight included) or two date-times, a start time moved forward or back by a duration, or a column of h:mm durations totalled - each answer in h:mm, decimal hours and minutes.
Live preview
Under the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/time-duration-calculator" title="Time Duration Calculator by A2Z Tools" width="100%" height="560" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="time-duration-calculator" data-height="560"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
Every value is turned into whole minutes before any arithmetic, which avoids the classic spreadsheet mistake of adding 0:45 and 0:30 to get 0:75. Between two clock times the answer is end minus start; if the end is earlier, the span is taken to cross midnight and 24 hours are added, so 22:00 to 06:30 is 8:30. Between two date-times the difference of the wall-clock readings is used, which allows spans of days and shows a negative answer if the second moment is earlier. Adding or subtracting a duration wraps around the 24-hour clock and says whether the result lands on the next or previous day: 23:30 plus 1:45 is 01:15 the next day. In list mode each line or comma-separated item may be h:mm (1:30), decimal hours (1.5) or negative (-0:15) for a correction. Results are given as h:mm, as decimal hours to two places (8:30 = 8.50) and as total minutes. Unlike the date difference calculator, which counts calendar days, months and years, this one works in hours and minutes.
Calculation method
- Minutes = hours x 60 + minutes; decimal hours = minutes / 60
- Clock span = end - start, plus 1,440 minutes when end < start (overnight)
- Time + duration = (start + d) mod 1,440; day shift = floor((start + d) / 1,440)
- List total = sum of every entry in minutes, shown as h:mm with minutes carried at 60
Worked examples
Night shift
Inputs: 22:00 to 06:30
Result: 8:30 = 8.50 hours = 510 minutes
The end is earlier than the start, so 24 hours are added: 390 - 1,320 + 1,440 = 510.
Adding a list
Inputs: 7:45, 8:10, 6:55, 8:00, 7:30
Result: 38:20 = 38.33 hours
2,300 minutes in total; 2,300 / 60 = 38.33.
Limitations
- Daylight-saving changes between two date-times are not counted.
- Seconds are not supported; everything is rounded to whole minutes.
- List mode accepts at most 500 entries.
Where publishers use it
- Freelancer and agency blogs explaining how to total billable time before invoicing
- Nursing and shift-work forums checking how long a night shift really ran
- Video editors and podcasters adding segment lengths to hit a target running time
- Aviation and logbook sites totalling flight hours written as h:mm
- Teachers' sites helping pupils with elapsed-time maths homework
Questions
How do I convert 7 hours 45 minutes to decimal hours?
Divide the minutes by 60: 45 / 60 = 0.75, so 7:45 is 7.75 hours. The widget shows this conversion for every answer; 8:20 becomes 8.33 hours.
What happens if the end time is earlier than the start?
The widget assumes the period runs past midnight. 21:00 to 05:30 is 8 hours 30 minutes. For spans longer than 24 hours, use the date-and-time mode.
Can I subtract a break or a correction in list mode?
Yes. Prefix an entry with a minus sign: 8:00, -0:30 gives 7:30. Decimal entries such as -0.25 (a quarter hour) also work.
Does it allow for daylight saving?
No. Date-times are compared as clock readings, so on the night clocks go back a 22:00-06:00 shift shows 8 hours although 9 hours passed. Add or remove that hour yourself.
Can I add up lap or segment times?
Yes, as long as each is in hours and minutes. For a podcast edit of 0:12, 0:18 and 0:27 the total is 0:57; a running relay or a stopwatch split list in seconds needs converting to h:mm first.
How is this different from the timesheet and date difference widgets?
The timesheet calculator totals a working week with breaks and overtime; the date difference calculator counts days, weeks and months between dates. This widget does general hour-and-minute arithmetic on any times.
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools Time Duration Calculator https://a2z.tools/embed/time-duration-calculator
<a href="https://a2z.tools/embed/time-duration-calculator">A2Z Tools Time Duration Calculator</a>
[A2Z Tools Time Duration Calculator](https://a2z.tools/embed/time-duration-calculator)
Time Duration Calculator by A2Z Tools - https://a2z.tools/embed/time-duration-calculator
Related widgets
-
Years, months and days between two dates or date-times, plus totals in days, weeks and hours.
-
Seven-day timesheet with start, end and unpaid breaks, night shifts, overtime and gross pay.
-
Convert a date and time between any two time zones, with daylight-saving gaps and overlaps explained.
-
ISO 8601 week number, the week's Monday-Sunday dates, day of the year and the US week count.
-
Live days, hours, minutes and seconds to a date you set, with an "event has started" message.
-
Exact age in years, months and days, totals in months, weeks and days, and the next birthday.