Time Calculator

Two modes in one calculator.

Time & Date Difference + add/sub h:m:s + decimal
Rate this calculator · 5.0 (1)

Time Calculator (Difference / Add / Subtract)

ISO 8601 · 24-hour clock · NIST SI second

Instructions — Time Calculator

1

Pick a mode

Toggle between Difference (between two times) and Add / subtract (start time plus or minus a duration). The Difference mode answers questions like "how long is my work shift" or "how much time between meetings." The Add mode answers "what time will it be when I finish this 4-hour task that starts at 10:30."

2

Enter the times

Use the 24-hour clock (HH:MM:SS). 09:00:00 is 9 AM; 17:30:00 is 5:30 PM; 23:59:59 is one second before midnight. If your end time is earlier than your start in Difference mode, the calculator wraps to the next day — useful for overnight shifts (22:00 → 06:00 = 8 hours). Quick pick buttons set common end times in one click.

3

Read the result

Difference mode shows h:m:s, decimal hours (8.5 = 8h 30m), total minutes, and total seconds — the four formats payroll, scientific notebooks, and software use. Add mode shows the resulting clock time in 24-hour and 12-hour AM/PM formats. If the result rolls past midnight or before 00:00, the calculator marks the day offset (+1 day, −1 day, etc.).

Overnight shifts: A shift from 22:00 to 06:00 is 8 hours. Enter start 22:00 and end 06:00 — the calculator wraps automatically and labels the result "next day." For shifts longer than 24 hours, add 24:00:00 in Add mode.
Decimal hours for payroll: US payroll software typically uses decimal hours rather than h:m. 8:30 = 8.5 hours. 8:15 = 8.25. 8:45 = 8.75. The Difference mode shows both forms; copy the decimal value into a timesheet.

Formulas

The calculator converts each time to seconds since midnight (0–86,399), does the arithmetic in integer seconds, and converts back. This avoids floating-point error and handles overflow into the next day cleanly. The SI second is defined by NIST as 9,192,631,770 cycles of caesium-133 radiation — every clock and calculator that reports seconds is calibrated against that standard.

Time to seconds
$$ t_s = h \times 3600 + m \times 60 + s $$
Convert any clock time to a single integer of seconds since midnight. 09:30:00 → 34,200. 17:45:30 → 63,930. All time arithmetic in software is done in this form.
Difference between times
$$ \Delta t = t_2 - t_1 + 86400 \cdot [\Delta t < 0] $$
Subtract start from end in seconds. If negative, add 86,400 (one day) to wrap into next-day territory. This is how the calculator handles overnight shifts without you flagging them explicitly.
Add a duration
$$ t_{end} = (t_{start} + d) \bmod 86400 $$
Sum start and duration in seconds; take modulo 86,400 to fit back inside the 24-hour clock. The integer division floor(.) ÷ 86,400 gives the day offset (positive for next day, negative for previous).
Seconds back to h:m:s
$$ h = \lfloor t / 3600 \rfloor,\; m = \lfloor (t \bmod 3600) / 60 \rfloor,\; s = t \bmod 60 $$
Pull hours, then minutes, then seconds via integer division and modulo. Pad each piece to two digits for display: 4h 5m 7s → 04:05:07.
Decimal hours
$$ h_\text{dec} = h + \frac{m}{60} + \frac{s}{3600} $$
Payroll, science, and engineering report time as a decimal. 8:30:00 = 8.5 hours; 8:15:00 = 8.25; 8:45:00 = 8.75. Divide by 3600 to get hours from a seconds count.
12-hour ↔ 24-hour
$$ h_{24} = (h_{12} \bmod 12) + 12 \cdot [\text{PM}] $$
From 12-hour AM/PM to 24-hour: take h mod 12 (so 12 AM → 0 and 12 PM → 0), add 12 if PM. Reverse: 24-hour 00:xx is 12:xx AM; 12:xx is 12:xx PM; 13-23 is 1-11 PM. ISO 8601 uses 24-hour exclusively.

Reference

Common durations in h:m:s and decimal hours
h:m:sDecimalMinutesSeconds
00:15:000.2515900
00:30:000.50301,800
00:45:000.75452,700
01:00:001.00603,600
04:00:004.0024014,400
08:00:008.0048028,800
08:30:008.5051030,600
12:00:0012.0072043,200
24:00:0024.001,44086,400

24-hour clock ↔ 12-hour clock

AM
24h12h
00:0012:00 AM
06:006:00 AM
09:009:00 AM
11:5911:59 AM
PM
24h12h
12:0012:00 PM
13:301:30 PM
17:455:45 PM
23:5911:59 PM

Source: ISO 8601 date-time format. The 24-hour clock is the international standard for aviation, medicine, military, and software. 12 AM is midnight (start of day); 12 PM is noon — a common source of confusion.

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.”

Did you know

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.

Difference
End − Start
Shift length, gap
Add
Start + Duration
When will I finish

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.

Tip

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.

Time arithmetic cheat sheet
1 hour 3,600 seconds
1 day 86,400 seconds
8:30 = 8.5 decimal hours
15 min 0.25 h
12 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
12 AM is midnight, not noon

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.

FAQ

Subtract the start time from the end time, in seconds. If the end time is earlier (overnight shift), add one day's worth of seconds (86,400). The calculator above does this automatically. Example: 09:00 to 17:30 = 8 hours 30 minutes = 30,600 seconds = 8.5 decimal hours.
If end time is before start time, it wraps to the next day. A shift from 22:00 to 06:00 yields 8 hours, not −16. The result line marks the wrap explicitly. For shifts longer than 24 hours, use Add mode: start at 22:00, add 30h, get the end time on the second day.
Same duration, different format. 8:30 is h:m notation: 8 hours and 30 minutes. 8.5 is decimal hours: 8 + 30/60 = 8.5. US payroll systems usually require decimal hours; international time is reported in h:m:s. The calculator shows both formats for every result.
12 AM is midnight (the start of the day); 12 PM is noon. The 12-hour clock has no "0 o'clock," so the 12 hour serves twice and the AM/PM tag is critical. The 24-hour clock removes the ambiguity: 00:00 is midnight, 12:00 is noon, 24:00 is the next midnight. ISO 8601 mandates 24-hour.
The base-60 system comes from ancient Sumerian and Babylonian astronomy (around 2000 BCE). 60 is divisible by 2, 3, 4, 5, 6, 10, 12, 15, 20, and 30, which made fractions easy without a positional decimal system. The convention propagated through Greek, Arab, and European mathematics; the modern second is defined by NIST in terms of caesium-133 atomic transitions but the 60-fold subdivision is preserved by convention.
Multiply. 1 hour = 60 minutes = 3,600 seconds. 1 minute = 60 seconds. So 2.5 hours = 150 minutes = 9,000 seconds. The Difference mode in the calculator shows all three units side by side for any computed duration.
Yes, in Add mode. Enter a start time and add a duration of, say, 30 hours. The result wraps to the next day and the offset is shown as (+1 day). For very long durations (months, years), use a dates-and-times calculator that handles the calendar — this one is for clock arithmetic only.
The international standard for date and time. Time is written HH:MM:SS in 24-hour notation, optionally with fractional seconds and a timezone (Z for UTC or ±HH:MM offset). Examples: 14:30:00, 14:30:00.500, 14:30:00Z, 14:30:00-05:00. The calculator uses the basic HH:MM:SS form.