Article — Time Calculator
Time Calculator: Compute Differences and Add Durations
A time calculator does two things: find the duration between two clock times, or add and subtract durations to a start time. The math runs in integer seconds. To find a difference, convert each time to seconds since midnight (HH × 3600 + MM × 60 + SS), subtract, and wrap by adding 86,400 if the result is negative (overnight shifts). To add, sum the seconds and take modulo 86,400 to fit back inside 24 hours. The SI second is defined by NIST as 9,192,631,770 caesium-133 cycles. Sources: NIST, US Naval Observatory, ISO 8601.
The calculator above offers both modes in one interface. Difference returns h:m:s, decimal hours, total minutes, and total seconds. Add and subtract return a clock time with a day-rollover label when the result crosses midnight.
What this time calculator does
This time calculator handles clock-time arithmetic — the math you do every time you compute a shift length, an arrival time, or a meeting duration. It does not handle dates (use a date calculator for those) or time zones (use a time-zone converter). Within the 24-hour clock, every operation runs in integer seconds for exactness.
Two modes cover the common questions. Difference: “how long is my work shift,” “how much time between the two appointments,” “how long was that movie.” Add or subtract: “what time will it be in 90 minutes,” “when do I need to leave to arrive by 14:00 if the trip takes 35 minutes,” “what time did I start this 4-hour task that finished at 18:30.”
The 24-hour clock dates back to ancient Egypt (~1500 BCE), which divided daylight and night into 12 parts each. The 60-fold subdivision of the hour into minutes and seconds came from Sumerian and Babylonian astronomy around 2000 BCE — base-60 made fractions easy. The SI second has been defined since 1967 by atomic transitions; before that it was 1/86,400 of a mean solar day.
How time arithmetic works
Convert each clock time to a single integer of seconds since midnight: hours times 3600 plus minutes times 60 plus seconds. 09:30:00 becomes 34,200. 17:45:30 becomes 63,930. All arithmetic happens on these integers, which keeps the answer exact and immune to floating-point drift.
To convert back to h:m:s, divide by 3600 for hours, take the remainder and divide by 60 for minutes, and the remainder of that is seconds. Pad each piece to two digits: 4 hours 5 minutes 7 seconds displays as 04:05:07. This convention follows ISO 8601, the international standard adopted by aviation, medicine, military, and software.
Time difference mode
The difference is end minus start in seconds. If end is earlier than start, add 86,400 (one day) to wrap into next-day territory — this is how the calculator handles overnight shifts without you flagging them explicitly. Convert the resulting seconds count to h:m:s, decimal hours, total minutes, and total seconds.
Example: start 09:00:00 (32,400 s), end 17:30:00 (63,000 s). Difference = 30,600 seconds = 8.5 decimal hours = 8 hours 30 minutes. Same shift in seconds: 30,600. In minutes: 510. The four formats cover every downstream use — payroll software wants decimal hours, calendar reminders want h:m, scientific notebooks want seconds.
Add and subtract time mode
Sum start time and duration in seconds. Take the result modulo 86,400 to fit inside a 24-hour clock. The integer division gives the day offset — 1 for next day, −1 for previous day, 2 for the day after tomorrow, and so on.
Example: start 22:00:00 (79,200 s) + 4 hours (14,400 s) = 93,600 s. Modulo 86,400 = 7,200 s = 02:00:00 on the next day. The calculator shows “02:00:00 (+1 day).” This is the correct answer for “when will the 4-hour task that started at 10 PM finish?” — it finishes at 2 AM the next morning.
For subtraction, enter a positive duration and toggle Subtract. The math runs identically: 06:00:00 − 8 hours = −7,200 s, which wraps to 22:00:00 on the previous day (−1 day label). Useful for “when did the shift start if it ended at 6 AM and was 8 hours long.”
Decimal hours and payroll time
US payroll software typically reports hours worked as a decimal: 8.5 hours instead of 8h 30m. Convert by dividing total minutes by 60 (or seconds by 3600). 30 minutes is 0.5 hours; 15 minutes is 0.25; 45 minutes is 0.75. The Difference mode in the calculator shows decimal hours alongside h:m:s automatically.
Some payroll systems round to the nearest tenth of an hour (6 minutes); others round to the nearest 15 minutes; a few use exact seconds. The Fair Labor Standards Act allows rounding to the nearest five minutes, six minutes, or quarter hour as long as the rounding does not systematically favour the employer. Track exact time and let the system round downstream.
24-hour vs 12-hour clock
The 24-hour clock runs from 00:00 (midnight, start of day) to 23:59 (one minute before midnight). The 12-hour clock runs from 12:00 (noon or midnight) through 11:59 with an AM/PM tag. 12 AM is midnight; 12 PM is noon — a common source of confusion. The 24-hour form is unambiguous and is the international standard for aviation, medicine, military, and software (ISO 8601 mandates it).
Conversion: from 12-hour to 24-hour, drop AM and use the hour as-is unless it is 12 (then use 0); for PM, add 12 unless the hour is already 12 (then leave it). The calculator's Add mode shows the result in both formats so you do not need to convert in your head.
1 hour 3,600 seconds1 day 86,400 seconds8:30 = 8.5 decimal hours15 min 0.25 h12 AM = 00:00 (midnight)12 PM = 12:00 (noon)Overnight shifts and wraparound
A shift from 22:00 to 06:00 is 8 hours, not negative 16. The calculator detects that end is before start and adds 24 hours to the difference. The Difference mode marks the result as “next day” so you know the shift crossed midnight.
For shifts longer than 24 hours (rare, but they exist — emergency medical, on-call, deep-sea fishing), switch to Add mode and supply a duration that exceeds 24h. The result will rollover by two or more days, labelled accordingly. For most users the Difference mode with single-day wrap is what you want.
- 1 hour = 60 minutes = 3,600 seconds (NIST SI second)
- 1 day = 24 hours = 1,440 minutes = 86,400 seconds
- Decimal hours: divide minutes by 60 (8:30 = 8.5 h)
- ISO 8601 mandates 24-hour clock with HH:MM:SS
- 12 AM = midnight; 12 PM = noon
- Overnight wrap: add 86,400 s if end < start
- FLSA rounding: nearest 5, 6, or 15 minutes is permitted for payroll
- Atomic clocks: accurate to one second in hundreds of millions of years
The most common time mistake is treating 12 AM as noon. 12 AM is midnight (start of day); 12 PM is noon. If a system says “event at 12:00 AM Tuesday” it means the moment Monday ends and Tuesday begins, not lunchtime on Tuesday. ISO 8601 and the 24-hour clock remove the ambiguity by using 00:00 for midnight and 12:00 for noon.
Common time calculation mistakes
Beyond the 12 AM / 12 PM confusion: converting minutes to decimal hours by simple division (40 minutes is 0.67 hours, not 0.40) is a frequent payroll error. Forgetting that overnight shifts wrap, treating them as negative durations. Subtracting times in their h:m form rather than converting to seconds first — easy to get the carry wrong. Mixing 12-hour and 24-hour notation in the same calculation: 5:00 in a 24-hour context is 5 AM; in a 12-hour context without AM/PM it is ambiguous. The calculator above runs in 24-hour seconds throughout, so all four errors disappear once you use it.