Time duration calculator
2 hours 15 minutes 30 seconds plus 1 hour 20 minutes 45 seconds is 3 hours 36 minutes 15 seconds, also shown as 216.25 minutes and 12,975 seconds. Switch to subtract to get the gap between two lengths. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Operation
- Add tax
- Hours a
- 2
- Minutes a
- 15
- Seconds a
- 30
- Hours b
- 1
- Minutes b
- 20
- Hours
- 3
- Minutes
- 36
- Seconds
- 15
- Total hours
- 3.6041666667
A time duration is a length of time, not a clock reading on a twelve-hour or twenty-four-hour face. When you add two hours fifteen minutes and thirty seconds to one hour twenty minutes and forty-five seconds, the combined duration is three hours thirty-six minutes and fifteen seconds. When you subtract the shorter block from the longer one, you get fifty-four minutes and forty-five seconds. This time duration calculator accepts two values in hours, minutes, and seconds, adds or subtracts them according to the chosen operation, and returns the combined duration in each unit: a normalized hours-minutes-seconds breakdown plus the same total expressed as hours, as minutes, and as seconds.
How two time values become a duration in every unit
A duration is a length of time measured independently of any calendar date or wall-clock reading. Converting each operand to a single integer second count is the only reliable way to add or subtract without carrying mistakes. The first time value contributes hours times three thousand six hundred plus minutes times sixty plus leftover seconds.
The second time value is converted with the same factors. The operation field then either adds those two integer totals or subtracts the second from the first. After that single integer is known, this time duration calculator reports the combined duration in each unit at once.
Whole hours are the total seconds divided by three thousand six hundred with the remainder discarded. Minutes in the conventional zero-to-fifty-nine range are that remainder divided by sixty. Leftover seconds sit in zero to fifty-nine.
The same integer is also returned as total hours, the exact decimal hours; as total minutes, the exact decimal minutes; and as total seconds. That triple view is what people who search for a time duration calculator actually want: a producer may need the pretty clock string for a credit roll, a timesheet may need decimal hours, and a video editor may need a raw second count for a timeline. Minutes or seconds that arrive already above fifty-nine are legal because this tool measures length, not a valid clock reading.
Seventy minutes is simply four thousand two hundred extra seconds. Hours are never wrapped at twenty-four: twenty-five hours of footage is twenty-five hours, not one o'clock. Subtracting a larger second value from a smaller first value is rejected, because a duration in this contract cannot be negative.
The algorithm never consults the system clock, never calls a network service, and never uses randomness, so the same pair of time values and the same operation always produce the same totals.
Where a time duration calculator earns its keep
People reach for a time duration calculator whenever two stopwatch readings must become one combined length, or whenever a longer block must lose a shorter one. Video editors add scene lengths to confirm a cut still fits a slot, then subtract a trailer they decided to drop. Podcasters sum intro and interview blocks before they publish a show note that quotes runtime, and later subtract an ad read they pulled.
Payroll clerks add ordinary hours to overtime minutes that arrived as a second pair, then subtract an unpaid break that was recorded the same way. Sports coaches combine drill blocks and rest intervals to print a session card, then subtract a cancelled warm-up. Project managers add two task estimates that were recorded as hours, minutes, and seconds instead of a single decimal hour.
Teachers demonstrate carrying and borrowing in sexagesimal arithmetic without forcing students to do the three-thousand-six-hundred and sixty conversion by hand. Because hours do not wrap at midnight, the same tool also totals multi-day work or travel time: forty hours plus eight hours is forty-eight hours, not a clock time of midnight. Pin the pretty string and the three unit totals in your tests and you get a reproducible duration for homework, LMS plugins, and edge workers without standing up a calendar library of your own.
What you can do with it
Video and podcast runtimes
Add two clip lengths given as hours, minutes, and seconds, or subtract a dropped segment, and read the combined duration as HMS, decimal hours, minutes, and seconds.
Timesheets with paid and unpaid blocks
Add a regular shift to an overtime block, then subtract an unpaid break that arrived as a second HMS pair, without wrapping at midnight.
Classroom sexagesimal carrying
Let students check that adding seventy minutes to ninety seconds, or subtracting a shorter drill from a longer one, normalizes correctly instead of inventing an illegal clock face.
FAQ
What happens if a component is negative or not a number?
A duration in this contract cannot contain a negative or non-numeric clock field, and that failure is not billed.
Can I subtract a longer time value from a shorter one?
Swap the two time values, or use add if you meant to combine them.
How do I subtract one duration from another?
Choose subtract and enter the longer duration first. The second value is taken from the first, so 2 hours 15 minutes 30 seconds minus 1 hour 20 minutes 45 seconds leaves 54 minutes and 45 seconds.
Can I see the result in minutes or seconds only?
Yes. Alongside the hours, minutes and seconds breakdown you get the same length as total hours, total minutes and total seconds, so 3 hours 36 minutes 15 seconds also reads as 216.25 minutes or 12,975 seconds.
Can I enter fractions such as 1.5 hours?
No. Every part must be a whole number, so enter 1.5 hours as 1 hour and 30 minutes. Minutes and seconds above 59 are fine, because they are carried into the next unit.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/life/time-duration \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"operation":"add","hours_a":2,"minutes_a":15,"seconds_a":30,"hours_b":1,"minutes_b":20,"seconds_b":45}'const res = await fetch("https://api.kit.forhosting.com/life/time-duration", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"operation": "add",
"hours_a": 2,
"minutes_a": 15,
"seconds_a": 30,
"hours_b": 1,
"minutes_b": 20,
"seconds_b": 45
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/life/time-duration",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"operation": "add",
"hours_a": 2,
"minutes_a": 15,
"seconds_a": 30,
"hours_b": 1,
"minutes_b": 20,
"seconds_b": 45
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/life/time-duration", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"operation":"add","hours_a":2,"minutes_a":15,"seconds_a":30,"hours_b":1,"minutes_b":20,"seconds_b":45}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"operation":"add","hours_a":2,"minutes_a":15,"seconds_a":30,"hours_b":1,"minutes_b":20,"seconds_b":45}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/life/time-duration", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"operation": "add",
"hours_a": 2,
"minutes_a": 15,
"seconds_a": 30,
"hours_b": 1,
"minutes_b": 20,
"seconds_b": 45
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "life.time_duration",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_component | 1000000000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Negative or non-numeric components are rejected with invalid_input, because a duration in this contract cannot contain a negative or unreadable clock field.
Input contract, response shape, and error behaviour
Every component is required. A negative component also fails, because a duration in this contract cannot contain a negative clock part; the error message states that the field must be a non-negative integer. Whole numbers written as decimal-free numeric strings are accepted so forms and CSV pipelines can post text. Invalid input is not billed. The request body carries an operation and six integer fields. operation must be add or subtract; any other string, including a blank, fails with invalid_input. hours_a, minutes_a, and seconds_a describe the first time value. hours_b, minutes_b, and seconds_b describe the second. A missing field, an empty string, a boolean, a fractional number such as one point five, or a non-numeric string fails with invalid_input and names the offending field. On success the response reports operation, a normalized breakdown of hours unbounded by midnight, minutes in zero to fifty-nine, seconds in zero to fifty-nine, total_hours and total_minutes as rounded decimals, total_seconds as the exact integer, a pretty string formatted as hours colon minutes colon seconds with zero-padded minutes and seconds, and a short formula string you can show next to the answer. Successful API calls use the published $0.002 base price.
Where a time duration calculator earns its keep
That keeps latency at a few arithmetic operations and keeps the cost model honest at $0.002 per successful API request, while failed validation never consumes prepaid balance.
Technical questions
How do I calculate a time duration from hours, minutes, and seconds?
Send operation as add or subtract plus six non-negative integers: hours_a, minutes_a, seconds_a and hours_b, minutes_b, seconds_b. The API converts each value to seconds, combines them, and returns the duration in hours, minutes, and seconds.
What does “the combined duration in each unit” mean?
The same total is reported three ways besides the normalized HMS breakdown: total_hours as decimal hours, total_minutes as decimal minutes, and total_seconds as an integer second count.
What does the time duration calculator cost?
The browser tool is free. API requests use prepaid balance at $0.002 per successful call; invalid input is not billed.