ユーティリティ

Time Calculator: Add, Subtract, and Convert Time

How to perform arithmetic with hours, minutes, and seconds. Conversion between time formats, with worked examples and practical uses.

Verified against NIST - Time and Frequency Division on 20 Feb 2025 Updated 20 February 2025 4 min read
計算ツールを開く

Translation unavailable - this article is shown in English. View English version

Summary

Time arithmetic — adding, subtracting, and converting between hours, minutes, and seconds — comes up constantly in everyday life: tracking work hours, timing recipes, logging exercise, calculating travel duration, and scheduling events. Unlike decimal arithmetic, time uses a base-60 system (sexagesimal) for minutes and seconds, which makes carrying and borrowing less intuitive. This calculator handles the conversions automatically.

How it works

The calculator normalizes all time values to a single unit (seconds), performs the arithmetic, and then converts back to hours, minutes, and seconds:

  1. Convert to total seconds — hours * 3600 + minutes * 60 + seconds.
  2. Perform arithmetic — add or subtract the total seconds.
  3. Convert back to HMS — divide by 3600 for hours, then by 60 for minutes, with the remainder as seconds.

This approach avoids the complexity of carrying across the 60-second and 60-minute boundaries.

The formulas

Total seconds = hours * 3600 + minutes * 60 + seconds

Where

hours= The hours component
3600= Seconds per hour (60 * 60)
minutes= The minutes component
seconds= The seconds component
HMS: h = floor(T/3600), m = floor((T mod 3600)/60), s = T mod 60

Where

T= Total time in seconds
h= Hours component
m= Minutes component
s= Seconds component

Worked examples

Add 2h 45m 30s and 1h 30m 50s

1

Convert first time to seconds

2*3600 + 45*60 + 30 = 7200 + 2700 + 30

= 9,930 seconds

2

Convert second time to seconds

1*3600 + 30*60 + 50 = 3600 + 1800 + 50

= 5,450 seconds

3

Add totals

9,930 + 5,450

= 15,380 seconds

4

Convert back to HMS

15,380 / 3600 = 4h remainder 980s; 980 / 60 = 16m remainder 20s

= 4h 16m 20s

Result

2h 45m 30s + 1h 30m 50s = 4h 16m 20s

Subtract 45 minutes from 1h 20m

1

Convert 1h 20m to seconds

1*3600 + 20*60 = 3600 + 1200

= 4,800 seconds

2

Convert 45m to seconds

45*60

= 2,700 seconds

3

Subtract

4,800 - 2,700

= 2,100 seconds

4

Convert back to HMS

2,100 / 3600 = 0h remainder 2100s; 2100 / 60 = 35m remainder 0s

= 0h 35m 0s

Result

1h 20m - 45m = 35 minutes

Practical uses

  • Work time tracking — adding up time entries for timesheets or project billing.
  • Cooking — combining prep time and cook time to know total recipe duration.
  • Exercise logging — summing lap times, intervals, or workout segments.
  • Travel — adding flight time, layover, and ground transport to calculate total journey duration.
  • Media production — calculating total runtime from individual segment durations.

Assumptions & limitations

  • No date rollover — the calculator works with durations, not clock times. Adding 5 hours to 10:00 PM gives a 15-hour duration total, not “3:00 AM tomorrow.” For clock-time arithmetic, use a date-time calculator.
  • Negative results — subtracting a larger time from a smaller one produces a negative duration, displayed with a minus sign.
  • Precision — the calculator works with whole seconds. Sub-second precision (milliseconds) is not supported.
  • 24-hour format — when displaying results as clock time equivalents, the calculator uses 24-hour format. Times beyond 24 hours are shown as total hours (e.g., 26h 30m), not as days.

出典

Gov
time-calculator hours-minutes-seconds time-arithmetic conversion utility