About this tool
The Time Calculator adds or subtracts durations in hours, minutes, and seconds. Handles carry-over automatically. Useful for totaling work time, exercise logs, and project tracking.
About time arithmetic
Time arithmetic is the mathematics of clocks and durations. Adding "2 hours 45 minutes" to "1 hour 30 minutes" feels intuitive but requires a base-60 carry: 75 minutes overflows to 1 hour 15 minutes. Subtracting a later time from an earlier one, or crossing midnight, adds the wrap-around rule of modular arithmetic. This calculator handles HH:MM:SS arithmetic (add, subtract, multiply, divide), conversions between decimal hours and HH:MM:SS, and the time difference between two clock readings, including overnight shifts.
Real-world demand is everywhere. A nurse adds up patient-care hours across an overnight shift. A video editor sums clip durations to check total runtime. A factory supervisor calculates worked hours for payroll. A runner converts splits to a finish-time projection. A parent tracks baby feed intervals. The base-60 (sexagesimal) carry on minutes and seconds is the only thing that distinguishes this from regular decimal arithmetic, and it is exactly where most spreadsheet formulas trip up.
How time arithmetic works
The simplest approach is to convert everything to a single base unit (seconds), do regular integer arithmetic, then convert back. Every duration on this calculator is internally stored as a total-second integer and rendered as HH:MM:SS.
total_seconds = hours x 3600 + minutes x 60 + seconds add = total_a + total_b subtract = total_a - total_b (add 86400 if negative for overnight) multiply = total x factor divide = total / divisor HH:MM:SS = (T div 3600) : ((T mod 3600) div 60) : (T mod 60) decimal_hours = total_seconds / 3600
- 3600 = seconds in one hour (60 x 60).
- 86400 = seconds in one calendar day (24 x 3600).
- mod = modulo, the remainder after integer division.
- div = integer division (drop fractional part).
Worked example: payroll for an overnight shift
A nurse clocks in at 22:30 and clocks out at 07:15 the next morning. They took a 30-minute unpaid meal break. Calculate paid hours.
- Adjust for midnight crossing: end time 07:15 the next day equals 31:15 in the same-day frame (add 24 hours).
- Elapsed time: 31:15 minus 22:30 = 8 hours 45 minutes (8.75 hours).
- Subtract break: 8 h 45 m minus 30 m = 8 hours 15 minutes (8.25 hours).
- Convert to decimal hours for payroll: 8 + 15/60 = 8.25 hours.
- Pay calculation: 8.25 hours x $32 per hour x 1.15 night-shift differential = $303.60.
Common time conversions
| Unit | Seconds | Minutes | Hours | Days |
|---|---|---|---|---|
| 1 minute | 60 | 1 | 0.0167 | 0.000694 |
| 1 hour | 3,600 | 60 | 1 | 0.0417 |
| 1 day | 86,400 | 1,440 | 24 | 1 |
| 1 week | 604,800 | 10,080 | 168 | 7 |
| 30-day month | 2,592,000 | 43,200 | 720 | 30 |
| 365-day year | 31,536,000 | 525,600 | 8,760 | 365 |
| Leap year | 31,622,400 | 527,040 | 8,784 | 366 |
Pitfalls to avoid
- Treating 1:30 as 1.30. 1 hour 30 minutes is 1.5 decimal hours, not 1.3. The fraction is minutes divided by 60, not minutes divided by 100.
- Forgetting overnight wrap. Subtracting 22:30 from 07:15 raw gives a negative 15:15. Add 24 hours when the end time is earlier than the start time.
- Ignoring daylight savings. A 24-hour clock period that straddles the spring-forward switch has only 23 hours of wall-clock time; this calculator ignores DST since it deals with durations, not calendar timestamps.
- Mixing 12-hour and 24-hour formats. 12:00 PM means noon (12:00 in 24-hour); 12:00 AM means midnight (00:00). Many spreadsheet formulas treat 12:00 AM as 12:00, an error of 12 hours.
- Leap-second drift. UTC adds occasional leap seconds, so two timestamps months apart can differ by total_seconds + 1 or 2. For payroll-level precision this is negligible; for GPS or NTP work it matters.
- Negative durations from typos. A start time of 17:00 and end time of 07:00 looks fine but is ambiguous: same day (you went back in time, an error) or next day (overnight). The calculator assumes overnight.
Related tools on 3Tej
Frequently asked questions
How do I add times together?
Add seconds first, carry over to minutes when seconds reach 60, then add minutes and carry to hours when minutes reach 60. Example: 2:45:30 plus 1:30:45 equals 4:16:15 (75 seconds becomes 1 min 15 sec; 76 minutes becomes 1 hour 16 min).
How do I subtract times when the second time is earlier in the day?
If end time is earlier than start time, add 24 hours to the end time before subtracting (this handles shifts that cross midnight). For example, 23:30 to 07:15 the next morning: treat end as 31:15, then 31:15 minus 23:30 equals 7:45, which is 7 hours 45 minutes.
How many seconds are in a day, week, month, or year?
86,400 seconds in a day (24 x 3600), 604,800 in a week, 2,592,000 in a 30-day month, and 31,536,000 in a 365-day year (31,622,400 in a leap year). Programmers often use 86400 as the second-count for one day in cron schedules and TTL settings.
How do I convert decimal hours to hours, minutes, and seconds?
Take the integer part as hours. Multiply the decimal part by 60 to get minutes (integer part). Multiply the new decimal part by 60 to get seconds. Example: 2.575 hours equals 2 hours plus 0.575 x 60 = 34.5 minutes, equals 2 hours 34 minutes 30 seconds.
What is the difference between elapsed time and duration?
Elapsed time is the wall-clock interval between two timestamps, ignoring timezone changes (so a 2-hour video meeting that spanned daylight-savings has 2 hours of elapsed media playback). Duration in scheduling tools usually means working time, excluding breaks and weekends; this calculator gives raw elapsed time, not business hours.
