Time Calculator: Adding Hours, Minutes and Seconds to a Clock Time
By FindMySum · Last reviewed
A time calculator does arithmetic on a clock: add 2 hours and 30 minutes to 9:00, take 45 minutes off a departure time, or find how long it is from 22:15 to 06:45. Clock arithmetic is awkward by hand because it mixes bases. Seconds and minutes roll over at 60, hours at 24, and the 12-hour clock adds AM and PM on top. The calculator removes the carrying by converting everything to seconds, doing one addition or subtraction, and converting back. This article explains that method, works through the page's starting values, and covers how to read results that cross midnight.
The method: everything in seconds
A clock time is converted to seconds since midnight:
seconds = hours × 3,600 + minutes × 60 + seconds
So 09:00:00 is 32,400 seconds and 17:30:00 is 63,000. A duration is converted the same way. The calculator then works in three modes.
Add puts the duration on top of the start time. Subtract takes it off. If the result goes past 86,400 seconds (24 hours) or below zero, the calculator divides out the whole days, reports how many days later or earlier the result lands, and keeps the remainder as the clock time. That is why adding 30 hours to a time gives a clock time 6 hours later, one day on.
Time between subtracts the start from the end. If the end is earlier on the clock than the start, the calculator assumes it is the next day and adds 24 hours, which is the right reading for an overnight shift or a red-eye flight. It never assumes more than one day, so a span of more than 24 hours needs the days between dates calculator for the whole days plus this calculator for the remainder.
The result is shown in 24-hour form (HH:MM:SS, as in ISO 8601) and in 12-hour form with AM or PM, along with the duration in decimal hours.
Worked example: the calculator's starting values
The page opens with a start time of 09:00:00, the add operation, and a duration of 2 hours, 30 minutes and 0 seconds. The engine works it like this:
- Start: 9 × 3,600 = 32,400 seconds after midnight.
- Duration: 2 × 3,600 + 30 × 60 = 9,000 seconds, which is 2.5 decimal hours.
- Add: 32,400 + 9,000 = 41,400 seconds.
- Convert back: 41,400 ÷ 3,600 = 11 hours with 1,800 seconds left, and 1,800 ÷ 60 = 30 minutes. The result is 11:30:00, or 11:30:00 AM, on the same day.
The page shows the result, the time added (2 hours 30 minutes, which is 150 minutes or 9,000 seconds) and the day it lands on. Expressed from midnight, 11:30 is 690 minutes or 41,400 seconds into the day, which is the form some scheduling and transit data uses for a time of day ("minutes since midnight").
An overnight shift
Switch to time between, with a start of 22:15:00 and an end of 06:45:00. The end is earlier on the clock, so the engine treats it as the next morning: 86,400 − 80,100 + 24,300 = 30,600 seconds. The result is 08:30:00, a duration of 8 hours and 30 minutes, or 8.5 decimal hours, flagged as ending the next day. As in the other modes, the totals describe the duration: 510 minutes.
Going back more than a day
Subtract 30 hours from 01:00:00. Thirty hours is 108,000 seconds, and 3,600 − 108,000 = −104,400. Two whole days back is −172,800, leaving 68,400 seconds, so the engine returns 19:00:00 (7:00:00 PM), two days earlier. Counting it on a clock gives the same answer: back one hour to midnight, back 24 hours to the previous midnight, and back another 5 hours to 7 p.m. the evening before that.
Reading 12-hour and 24-hour results
| 24-hour | 12-hour | Note |
|---|---|---|
| 00:00:00 | 12:00:00 AM | Midnight, start of the day |
| 00:30:00 | 12:30:00 AM | Half past midnight, not 0:30 AM |
| 12:00:00 | 12:00:00 PM | Noon |
| 13:45:00 | 1:45:00 PM | Subtract 12 from hours 13 to 23 |
| 23:59:59 | 11:59:59 PM | Last second of the day |
The 12 o'clock hour is the usual source of mistakes: 12 AM is the start of a day and 12 PM is the middle. When there is any doubt, the 24-hour form is unambiguous, which is why transit timetables, aviation, hospitals and the ISO 8601 standard use it.
What the calculator doesn't do
Daylight saving time. Every day is treated as 24 hours. On the night clocks go back in November, a shift from 22:00 to 06:00 is 9 hours of real time; on the night they go forward in March, it is 7. The calculator shows 8 either way, so adjust by an hour for shifts that span the change.
Time zones. Times are plain clock readings with no zone. To find a flight's local arrival time, add the flight time to the departure time, then add or subtract the zone difference yourself.
Dates. The result says how many days later or earlier the time lands, not which date. For dates, use the date calculator.
Precision below a second. Inputs and results are whole seconds. Race timing or laboratory work that needs tenths or milliseconds needs a tool built for it.
Using the result
For a week of shifts with breaks and overtime, the time card calculator applies the same clock arithmetic to each day and then adds up pay. To convert a duration into another unit, such as hours into days or minutes into seconds, use the time converter. And when you need the number of calendar days between two events rather than hours on a clock, use the days between dates calculator.
More questions
How do I add up several durations, such as lap times or tracks on a playlist?
Start from 00:00:00 and add each duration in turn with the add operation, using the result as the next start time. While the running total stays under 24 hours, the result reads directly as hours, minutes and seconds. Past 24 hours, add 24 hours for each day the calculator says the result moved forward.
How do I turn decimal hours back into hours and minutes?
Keep the whole hours and multiply the decimal part by 60. 7.8 hours is 7 hours and 0.8 × 60 = 48 minutes. For timesheets that use hundredths of an hour, 0.25 is 15 minutes, 0.1 is 6 minutes and 0.01 is 36 seconds.
Is midnight 00:00 or 24:00?
Both appear in ISO 8601. 00:00 is the start of a day and 24:00 marks the end of a day, so 24:00 on 8 November is the same instant as 00:00 on 9 November. This calculator accepts times from 00:00:00 to 23:59:59 and shows midnight as 00:00:00 (12:00:00 AM).
Where does the correct time come from in Canada?
The National Research Council Canada keeps Canada's official time with atomic clocks and distributes it by radio, telephone and internet time servers. Phones and computers that sync over the internet are normally within a fraction of a second of it, which is far more precise than this calculator's one-second resolution.
Can I subtract one duration from another, not just from a clock time?
Yes, as long as the result is positive. Enter the longer duration as the start time and subtract the shorter one: 02:15:00 minus 0 hours 50 minutes gives 01:25:00. If the second duration is longer, the result wraps to the previous day, so swap the two and read the answer as a negative.
Why does the calculator show seconds when I only need minutes?
Clock times and durations are stored in seconds so that additions never round. If you are working in minutes, leave the seconds at zero; the result will always end in :00 and the totals in hours and minutes are unaffected.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.