Time Calculator

Add or subtract hours, minutes, and seconds, or find the exact duration between two clock times - with correct 24-hour rollover, sexagesimal arithmetic, and conversion between H:MM:SS and total seconds.

years
months
days
hours
minutes
seconds

Was this calculator helpful?

4.5/5 (23 votes)

Calculation Examples

Calculation Case Result
2 h 30 min + 1 h 45 min 4 h 15 min (9,000 + 6,300 = 15,300 s = 4 h 15 min 0 s)
Duration: 09:15 AM to 05:45 PM 8 h 30 min ((17 × 3600 + 45 × 60) − (9 × 3600 + 15 × 60) = 30,600 s)
Midnight rollover: 10:00 PM + 4 h 2:00 AM next day (22,000 + 14,400 = 36,000 s mod 86,400 = 02:00:00)
Convert 5,000 seconds floor(5000 ÷ 3600) = 1 h; floor(1400 ÷ 60) = 23 min; 1400 mod 60 = 20 s → 1:23:20

How to Use the Time Calculator

To add or subtract time: enter a starting time and the hours, minutes, or seconds you wish to add or subtract. To find duration between two times: enter the start time and end time. Click "Calculate" to see the result in hours:minutes:seconds format and as a total in seconds.

The calculator handles the 24-hour rollover automatically - adding 3 hours to 11:00 PM returns 2:00 AM (the next day), not 14:00 PM. For work-hour calculations where times cross midnight (e.g., a shift from 10:00 PM to 6:00 AM), the duration is computed correctly as 8 hours by treating the end time as belonging to the following calendar day.

How Time Measurement Works

The division of time into hours, minutes, and seconds is based on the sexagesimal (base-60) number system originating in Babylonian mathematics around 2000 BCE. The Babylonians used base-60 because 60 is highly divisible - it has 12 factors (1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60), making it convenient for fractional division. The ancient Greek astronomer Hipparchus (2nd century BCE) applied this system to divide the day into 24 hours and the hour into 60 minutes; the further division of minutes into 60 seconds was formalized in medieval Islamic astronomy.

This sexagesimal structure means time arithmetic is non-decimal and requires careful handling at unit boundaries: 90 seconds = 1 minute and 30 seconds (not 1.5 minutes in H:MM:SS notation); 75 minutes = 1 hour and 15 minutes. The calculator converts all inputs to a total in seconds ($T_{total} = (h \times 3600) + (m \times 60) + s$) before performing arithmetic and converts back to H:MM:SS format using modular division: $h_{final} = \lfloor T_{total} / 3600 \rfloor$, $m_{final} = \lfloor (T_{total} \bmod 3600) / 60 \rfloor$, $s_{final} = T_{total} \bmod 60$.

Time unit hierarchy: seconds, minutes, hours, and days with sexagesimal conversion relationships

Useful Tips 💡

  • When entering times in 12-hour format, always specify AM or PM. 12:00 PM (noon) and 12:00 AM (midnight) are the most frequently confused: 12:00 AM is the start of a new day (midnight), while 12:00 PM is midday. Use 24-hour format (00:00 for midnight, 12:00 for noon) to eliminate this ambiguity entirely.
  • For multi-shift payroll calculations, add each shift's duration separately rather than converting all start/end times to decimals. Decimal hours introduce rounding at each conversion step; working in H:MM:SS throughout and converting once at the end minimizes accumulated error.

📋Steps to Calculate

  1. Select the operation: Add Time, Subtract Time, or Find Duration between two times.

  2. Enter the starting time (or first time for duration) in hours, minutes, and seconds.

  3. Enter the time to add/subtract, or the end time for duration calculation.

  4. Click "Calculate" to see the result in H:MM:SS and in total seconds.

Mistakes to Avoid ⚠️

  1. Confusing clock time with duration. "2:30 PM" is a point in time; "2 hours 30 minutes" is a duration. Entering a clock time into a duration field (or vice versa) produces incorrect results. The calculator uses separate input fields to make this distinction explicit.
  2. Forgetting the midnight rollover in 12-hour format. Adding 4 hours to 10:00 PM produces 2:00 AM the following day - not 14:00. The calculator handles this automatically, but manual hour addition often produces "14 PM" as an invalid result.
  3. Subtracting a later start time from an earlier end time without accounting for the day boundary. A shift from 10:00 PM to 6:00 AM is 8 hours, not −16 hours. Treat the end time as belonging to the next calendar day when the end time (in 24-hour terms) is earlier than the start time.

Practical Applications📊

  1. Payroll and work-hour calculation: total the hours worked across multiple shifts, then verify against the scheduled hours. For shifts crossing midnight (e.g., 22:00–06:00), the calculator correctly returns 8:00 duration without requiring manual day-boundary adjustment.

  2. Project management and scheduling: sum task durations to find total project time, or subtract current elapsed time from the total budget to find remaining time. Convert the result to total minutes or hours for integration with scheduling tools that use decimal hours.

  3. Sports and training: calculate pace-based time targets (e.g., time to run a specific distance at a known pace), total training volume in time, or the exact split between two recorded checkpoint times from a GPS watch.

Questions and Answers

What does a time calculator do?

A time calculator performs three operations: (1) time addition - adding a duration (hours, minutes, seconds) to a clock time to find the resulting time; (2) time subtraction - subtracting a duration from a clock time; and (3) duration calculation - finding the exact elapsed time between two clock times. All operations are performed using modular arithmetic with correct 24-hour rollover, so results crossing midnight are handled automatically.

How is the duration between two times calculated?

Duration is computed by converting both times to total seconds from midnight ($T = h \times 3600 + m \times 60 + s$), subtracting the start from the end, and converting the difference back to H:MM:SS format using integer division and modulo operations. If the end time in seconds is less than the start time (indicating a midnight crossing), 86,400 seconds (24 hours) is added to the end time before subtraction. Example: 10:00 PM to 2:00 AM = $2:00$ in seconds (7,200) + 86,400 − $22:00$ (79,200) = 14,400 seconds = 4 hours.

How does the calculator handle time that crosses midnight?

The calculator uses 24-hour modular arithmetic. When an addition result exceeds 86,400 seconds (24 hours), the modulo operation $T_{final} = T_{total} \bmod 86{,}400$ returns the correct time in the next day. Example: 22:00 + 4 hours = 26 hours = 26 × 3,600 = 93,600 s; 93,600 mod 86,400 = 7,200 s = 02:00:00. For duration calculations, if the end time is less than the start time (in seconds), the calculator adds 86,400 to the end before subtracting, assuming the end time is in the following calendar day.

What is the sexagesimal system and why is time measured in base 60?

The sexagesimal (base-60) system originated in Babylonian mathematics around 2000 BCE. 60 was chosen as the base because it has 12 factors (1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60), making it exceptionally divisible into even fractions - 60 can be divided by more small integers than any smaller number. The Greek astronomer Hipparchus (2nd century BCE) applied this system to astronomical time, dividing the day into 24 hours and the hour into 60 minutes. Medieval Islamic astronomers further divided minutes into 60 seconds. This sexagesimal structure means time arithmetic requires base-60 conversion at each unit boundary, which the calculator handles using modular arithmetic.

What formulas are used in the time calculator?

All inputs are normalized to total seconds using: $T_{total} = (h \times 3600) + (m \times 60) + s$. Arithmetic (addition or subtraction) is performed on the total-seconds representations. The result is converted back to H:MM:SS using: $h_{final} = \lfloor T_{result} / 3600 \rfloor$; $m_{final} = \lfloor (T_{result} \bmod 3600) / 60 \rfloor$; $s_{final} = T_{result} \bmod 60$. For 24-hour rollover: $h_{displayed} = h_{final} \bmod 24$. For duration crossing midnight: $T_{duration} = (T_{end} + 86{,}400 - T_{start}) \bmod 86{,}400$.

How can I use the calculator for payroll and work hours?

Enter the start and end time of each shift to get the duration. For multiple shifts in a day or week, add the individual durations sequentially. For shifts crossing midnight (e.g., 22:00–06:00), the calculator returns the correct 8-hour duration automatically. Total hours worked across a pay period can be accumulated by adding shift durations one at a time. To convert the H:MM result to decimal hours for payroll systems: decimal hours = hours + (minutes ÷ 60). Example: 8:30 = 8 + 30/60 = 8.5 decimal hours.

How do I subtract time - for example, to find a start time from end time and duration?

Enter the known end time as the "Start Time" and the duration as a negative value (or use the subtraction mode). The calculator subtracts the duration in seconds and applies modular arithmetic. Example: shift ends at 17:30, lasted 7 hours 45 minutes - subtract 7:45 from 17:30: $T_{end} = 63{,}000$ s, $T_{duration} = 27{,}900$ s; $T_{start} = 63{,}000 - 27{,}900 = 35{,}100$ s = 09:45:00. For results that cross midnight into the previous day, 86,400 seconds is subtracted to produce the correct time.
Disclaimer: This calculator is designed to provide helpful estimates for informational purposes. While we strive for accuracy, financial (or medical) results can vary based on local laws and individual circumstances. We recommend consulting with a professional advisor for critical decisions.