Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Time Calculator (Add and Subtract Days, Hours, Minutes and Seconds)

Enter time 1 and time 2 in days, hours, minutes and seconds. You get both the sum (time 1 + time 2) and the difference (time 1 − time 2) at once.

Fields you do not need can be left blank (or 0). Large numbers such as 90 minutes or 36 hours can be entered as they are. When the difference is negative, it is shown with a minus sign in front.
Result
Enter two times (days, hours, minutes, seconds) in the fields on the left and press "Calculate". The result will appear here.

What you can do on this page

  • Add or subtract two lengths of time given in days, hours, minutes and seconds, such as "1 day 2 hours 30 minutes + 23 hours 45 minutes 10 seconds"
  • The sum (time 1 + time 2) and the difference (time 1 − time 2) are calculated and shown together
  • Carrying and borrowing at 60 seconds = 1 minute, 60 minutes = 1 hour and 24 hours = 1 day are done for you, and the steps in seconds are shown too
  • When a subtraction comes out negative, the result is shown clearly, as in "−1 day 2 hours"
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
This page adds and subtracts lengths of time, such as "2 hours 30 minutes". To add time to a date and time on the calendar, as in "What is 36 hours after 8:30 AM on July 12?", use the date and time calculator among the related pages.

What is this calculation used for?

Adding up hours worked and overtime (time card totals)

If you work 8 hours 45 minutes on Monday and 7 hours 50 minutes on Tuesday, the total for the two days is 16 hours 35 minutes (minutes: 45 + 50 = 95, which carries to 1 hour 35 minutes; hours: 8 + 7 + 1 = 16).
Payroll and time tracking add up each day's hours like this, and in the US, hours over 40 in a week are usually paid as overtime. Adding and subtracting time goes straight into everyone's paycheck.

Finding the difference between race times (sports)

If your marathon time this year is 3:28:50 and last year's was 3:45:30, you improved by 16 minutes 40 seconds (3:45:30 − 3:28:50 = 0:16:40).
In timed sports such as running, swimming and cycling, athletes calculate the gap to their personal best, or to a rival, down to the second to check their progress and pacing.

Estimating the total length of videos and audio (editing, playlists)

Watching a 1 hour 48 minute movie and a 2 hour 15 minute movie back to back takes 4 hours 3 minutes in total (minutes: 48 + 15 = 63, which carries over).
Adding up the lengths of clips in video editing, or estimating how long a playlist or a set of meeting recordings runs, is exactly this kind of time addition.

Adding up the time for cooking and tasks (planning)

A dish with 30 minutes of prep and 1 hour 45 minutes of simmering takes 2 hours 15 minutes in total from the start.
Adding up the time for each step tells you how long the whole thing takes, and subtracting it from mealtime tells you when to start. The same calculation helps you plan the steps of any job.

Finding how much sleep you are missing (health)

If your sleep goal is 7 hours and you actually slept 5 hours 30 minutes, you are 1 hour 30 minutes short.
Sleep tracking apps find "the gap from your goal" with this same subtraction. Seeing the shortfall as a number makes it easier to decide "I should go to bed early tonight".

Formula

Adding and subtracting times (sum and difference)
Standard notation (the usual math form)
\(S\) \(=\) \(T_1\) \(+\) \(T_2\)
\(D\) \(=\) \(T_1\) \(-\) \(T_2\)
In words (symbols replaced with words)
③ \(S\): sum of the two times \(=\) ① \(T_1\): time 1 \(+\) ② \(T_2\): time 2
\(D\): difference of the two times \(=\) \(T_1\): time 1 \(-\) \(T_2\): time 2
The formula in words
① Take \(T_1\): time 1
② add \(T_2\): time 2
③ and you get the \(S\): sum of the two times (subtract time 2 from time 1 instead, and you get the difference \(D\))
Quick example
For the sum of "1 day 2 hours 30 minutes" and "23 hours 45 minutes 10 seconds", putting each into seconds (formula 2 below) gives 95400 seconds and 85510 seconds, so
sum (2 days 2 hours 15 minutes 10 seconds) \(=\) time 1 (1 day 2 hours 30 minutes) \(+\) time 2 (23 hours 45 minutes 10 seconds)
\(95400 + 85510 = 180910\)
\(180910 = 86400 \times 2 + 3600 \times 2 + 60 \times 15 + 10\)
Key idea
Add and subtract days, hours, minutes and seconds unit by unit, and carry into the next larger unit when you pass 60 seconds, 60 minutes or 24 hours (for example, 30 minutes + 45 minutes = 75 minutes → 1 hour 15 minutes). Working with mixed units makes it easy to slip when carrying or borrowing, so this calculator first puts everything into seconds and does a single addition or subtraction (formulas 2 and 3 below). When a difference is negative, a single minus sign goes in front, as in "−1 day 2 hours", to show how much time is missing.
Putting a time into seconds
Standard notation (the usual math form)
\(T\) \(=\) \(86400\) \(\times\) \(d\) \(+\) \(3600\) \(\times\) \(h\) \(+\) \(60\) \(\times\) \(m\) \(+\) \(s\)
In words (symbols replaced with words)
⑧ \(T\): time in seconds \(=\) ② \(86400\): seconds in a day \(\times\) ① \(d\): days \(+\) ④ \(3600\): seconds in an hour \(\times\) ③ \(h\): hours \(+\) ⑥ \(60\): seconds in a minute \(\times\) ⑤ \(m\): minutes \(+\) ⑦ \(s\): seconds
The formula in words
① Take the \(d\): days
② and multiply by \(86400\): seconds in a day
③ take the \(h\): hours
④ and multiply by \(3600\): seconds in an hour
⑤ take the \(m\): minutes
⑥ and multiply by \(60\): seconds in a minute
⑦ add all of these and the \(s\): seconds
⑧ and you get the \(T\): time in seconds
Quick example
"1 day 2 hours 30 minutes" in seconds is
time in seconds (95400 s) \(=\) seconds in a day (86400) \(\times\) days (1 day) \(+\) seconds in an hour (3600) \(\times\) hours (2 hours) \(+\) seconds in a minute (60) \(\times\) minutes (30 minutes)
\(T = 86400 \times 1 + 3600 \times 2 + 60 \times 30 = 95400\)
Key idea
1 day = 24 hours, 1 hour = 60 minutes and 1 minute = 60 seconds, so a day has \(24 \times 60 \times 60 = 86400\) seconds and an hour has \(60 \times 60 = 3600\) seconds. A time in mixed units, such as "1 day and 2 hours 30 minutes", becomes a single addition or subtraction once everything is in the smallest unit, seconds. The "Step by step" part of this calculator's result shows time 1 and time 2 put into seconds with this formula.
Turning seconds back into days, hours, minutes and seconds (quotient and remainder)
Standard notation (the usual math form)
\(T\) \(=\) \(86400\) \(\times\) \(q\) \(+\) \(r\)
In words (symbols replaced with words)
④ \(T\): time in seconds \(=\) ① \(86400\): seconds in a day \(\times\) ② \(q\): days \(+\) ③ \(r\): seconds left over
The formula in words
① Take \(86400\): seconds in a day
② multiply by the \(q\): days
③ add the \(r\): seconds left over
④ and you get the \(T\): time in seconds (to find them, divide \(T\) by \(86400\). The quotient is the days \(q\) and the remainder is the seconds left over \(r\). Divide \(r\) by \(3600\) and then by \(60\) in the same way to split it into hours, minutes and seconds)
Quick example
To turn the sum in the formula 1 example, 180910 seconds, into days, hours, minutes and seconds, divide by 86400, 3600 and 60 in turn and use the quotients and remainders
time in seconds (180910 s) \(=\) seconds in a day (86400) \(\times\) days (2 days) \(+\) seconds left over (8110 s)
\(180910 = 86400 \times 2 + 8110\)
\(8110 = 3600 \times 2 + 910\)
\(910 = 60 \times 15 + 10\)
Key idea
Just by repeating division with remainders, a large number of seconds turns back into an easy-to-read form such as "2 days 2 hours 15 minutes 10 seconds". When a difference is negative, split the absolute value (the number without its sign) with this formula, then put a single minus sign in front (for example, −93784 seconds → −1 day 2 hours 3 minutes 4 seconds). This calculator leaves out units that are 0, and shows "0 seconds" when the whole result is 0.
The basics of adding and subtracting times: put the days, hours, minutes and seconds into seconds, add or subtract, then divide by 86400, 3600 and 60 in turn to get back to days, hours, minutes and seconds. Working in seconds turns everything into one calculation, with no mistakes in carrying or borrowing.

Symbols and terms

Symbols

\(T_1\), \(T_2\) T sub 1, T sub 2 The two times (lengths of time) you calculate with: time 1 (\(T_1\)) and time 2 (\(T_2\)). (Example - \(T_1\) = 1 day 2 hours 30 minutes, \(T_2\) = 23 hours 45 minutes 10 seconds)
\(S\) S The sum of the two times (time 1 + time 2), from the first letter of "sum".
\(D\) D (capital) The difference of the two times (time 1 − time 2), from the first letter of "difference". Do not confuse it with lowercase \(d\) (days).
\(d\), \(h\), \(m\), \(s\) d, h, m, s The parts of a time: days (\(d\)), hours (\(h\)), minutes (\(m\)) and seconds (\(s\)). For "1 day 2 hours 30 minutes", \(d = 1\), \(h = 2\), \(m = 30\) and \(s = 0\). They are the first letters of day, hour, minute and second.
\(T\) T (capital) A time written in seconds. Found with \(T = 86400d + 3600h + 60m + s\). (Example - 1 day 2 hours 30 minutes → 95400 seconds)
\(q\), \(r\) q, r When a time in seconds is divided by 86400, the quotient (the days \(q\)) and the remainder (the seconds left over \(r\)). For \(180910 \div 86400 = 2\) remainder \(8110\), \(q = 2\) and \(r = 8110\).

Terms

time of day A point in time, such as 8:30. It is different from a length of time, such as 2 hours 30 minutes. For calculations with a time of day ("What time will it be in 5 hours?"), use the date and time calculator among the related pages.
duration A length of time, such as 2 hours 30 minutes. It is different from a time of day, such as 8:30. This page adds and subtracts durations.
base 60 A way of counting where 60 makes one of the next larger unit (also called sexagesimal). 60 seconds carry to 1 minute, and 60 minutes carry to 1 hour. Note that between hours and days, you carry at 24 instead.
carrying In addition, moving the part that goes past the limit of a unit into the next larger unit (30 minutes + 45 minutes = 75 minutes → 1 hour 15 minutes). With time, you carry at 60 or 24.
borrowing In subtraction, taking what you are short from the next larger unit (1 hour 15 minutes − 30 minutes → 75 minutes − 30 minutes = 45 minutes). With time, you borrow 60 or 24.
quotient The answer to "how many times does it fit?" in a division. For \(180910 \div 86400 = 2\) remainder \(8110\), the quotient is \(2\), which is the number of days.
remainder What is left over when a division does not come out even. For \(180910 \div 86400 = 2\) remainder \(8110\), the remainder is \(8110\), the seconds left over that do not make a full day.
absolute value The size of a number without its sign (plus or minus). The absolute value of −93784 seconds is 93784 seconds. To split a negative time into days, hours, minutes and seconds, split the absolute value and then put a minus sign in front.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.

Time of day and elapsed time (Grades 2–3)
  • Knowing the difference between a time of day (a point in time, such as 8:30) and a duration (a length of time, such as 2 hours 30 minutes)
  • Knowing that 1 day = 24 hours, 1 hour = 60 minutes and 1 minute = 60 seconds
Adding and subtracting with regrouping (Grade 2)
  • Being able to do 2-digit addition and subtraction such as 30 + 45 = 75 and 60 − 30 = 30
  • Seeing that "minutes past 60 carry into hours, and hours past 24 carry into days" is the same idea as regrouping
Division with remainders (Grade 4)
  • Being able to find the quotient and remainder, as in 36 ÷ 24 = 1 remainder 12
  • Seeing that division with a remainder splits a large number of seconds into days, hours, minutes and seconds
Positive and negative numbers (Grades 6–7)
  • Knowing that when you subtract a larger number, the answer is negative, as in 60 − 90 = −30
  • Knowing that a negative answer means "short by that much"

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table for the sum and difference of two times
Time 1: days 1
Time 1: hours 2
Time 1: minutes 30
Time 1: seconds 0
Time 2: days 0
Time 2: hours 23
Time 2: minutes 45
Time 2: seconds 10
Time 1 in seconds =B1*86400+B2*3600+B3*60+B4
Time 2 in seconds =B5*86400+B6*3600+B7*60+B8
Sum (seconds) =B9+B10
Difference (seconds) =B9-B10
Sum: days =QUOTIENT(B11,86400)
Sum: hours =QUOTIENT(MOD(B11,86400),3600)
Sum: minutes =QUOTIENT(MOD(B11,3600),60)
Sum: seconds =MOD(B11,60)
Difference: days =QUOTIENT(ABS(B12),86400)
Difference: hours =QUOTIENT(MOD(ABS(B12),86400),3600)
Difference: minutes =QUOTIENT(MOD(ABS(B12),3600),60)
Difference: seconds =MOD(ABS(B12),60)
Table to put a time into seconds
Days 1
Hours 2
Minutes 30
Seconds 0
Time in seconds =B1*86400+B2*3600+B3*60+B4
Table to turn seconds back into days, hours, minutes and seconds
Time in seconds 180910
Days =QUOTIENT(B1,86400)
Hours =QUOTIENT(MOD(B1,86400),3600)
Minutes =QUOTIENT(MOD(B1,3600),60)
Seconds =MOD(B1,60)
In the first table, enter the days, hours, minutes and seconds of time 1 and time 2 in B1 to B8. B9 and B10 put them into seconds (95400 and 85510 seconds), B11 shows the sum (180910 seconds) and B12 shows the difference (9890 seconds). B13 to B16 split the sum into days, hours, minutes and seconds with QUOTIENT (the quotient of a division) and MOD (the remainder of a division), giving 2 days, 2 hours, 15 minutes and 10 seconds. B17 to B20 split the difference, giving 0 days, 2 hours, 44 minutes and 50 seconds.
The split of the difference uses ABS (absolute value). When B12 is negative, B17 to B20 show the parts without the sign, so look at the sign of B12 and read the result with a minus sign in front.
The second table gives 95400 (seconds), and the third gives 2 days, 2 hours, 15 minutes and 10 seconds. Just replace column B with your own numbers.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table for the sum and difference of two times
Time 1: days 1
Time 1: hours 2
Time 1: minutes 30
Time 1: seconds 0
Time 2: days 0
Time 2: hours 23
Time 2: minutes 45
Time 2: seconds 10
Time 1 in seconds =B1*86400+B2*3600+B3*60+B4
Time 2 in seconds =B5*86400+B6*3600+B7*60+B8
Sum (seconds) =B9+B10
Difference (seconds) =B9-B10
Sum: days =QUOTIENT(B11,86400)
Sum: hours =QUOTIENT(MOD(B11,86400),3600)
Sum: minutes =QUOTIENT(MOD(B11,3600),60)
Sum: seconds =MOD(B11,60)
Difference: days =QUOTIENT(ABS(B12),86400)
Difference: hours =QUOTIENT(MOD(ABS(B12),86400),3600)
Difference: minutes =QUOTIENT(MOD(ABS(B12),3600),60)
Difference: seconds =MOD(ABS(B12),60)
Table to put a time into seconds
Days 1
Hours 2
Minutes 30
Seconds 0
Time in seconds =B1*86400+B2*3600+B3*60+B4
Table to turn seconds back into days, hours, minutes and seconds
Time in seconds 180910
Days =QUOTIENT(B1,86400)
Hours =QUOTIENT(MOD(B1,86400),3600)
Minutes =QUOTIENT(MOD(B1,3600),60)
Seconds =MOD(B1,60)
In Google Sheets, QUOTIENT (the quotient of a division), MOD (the remainder of a division) and ABS (absolute value) work exactly as in Excel. Copy the whole table, paste it into cell A1, and replace column B with your own numbers. The answers are the same as in Excel.

How to calculate it in Python

# Time 1 and time 2 (days, hours, minutes, seconds)
days1, hours1, minutes1, seconds1 = 1, 2, 30, 0
days2, hours2, minutes2, seconds2 = 0, 23, 45, 10

total_seconds1 = days1 * 86400 + hours1 * 3600 + minutes1 * 60 + seconds1
total_seconds2 = days2 * 86400 + hours2 * 3600 + minutes2 * 60 + seconds2
sum_seconds = total_seconds1 + total_seconds2    # sum (seconds)
diff_seconds = total_seconds1 - total_seconds2   # difference (seconds)

def format_duration(total_seconds):
    # Turn seconds back into "2 days 2 hours 15 minutes 10 seconds" (units that are 0 are left out; a single minus sign in front)
    if total_seconds == 0:
        return "0 seconds"
    sign = "−" if total_seconds < 0 else ""
    rest = abs(total_seconds)
    days, rest = divmod(rest, 86400)
    hours, rest = divmod(rest, 3600)
    minutes, seconds = divmod(rest, 60)
    parts = []
    if days: parts.append(f"{days} day{'s' if days != 1 else ''}")
    if hours: parts.append(f"{hours} hour{'s' if hours != 1 else ''}")
    if minutes: parts.append(f"{minutes} minute{'s' if minutes != 1 else ''}")
    if seconds: parts.append(f"{seconds} second{'s' if seconds != 1 else ''}")
    return sign + " ".join(parts)

print(f"Time 1: {total_seconds1} seconds, time 2: {total_seconds2} seconds")
print(f"Sum: {format_duration(sum_seconds)} ({sum_seconds} seconds)")
print(f"Difference: {format_duration(diff_seconds)} ({diff_seconds} seconds)")
Runs with the standard library only. divmod is a function that returns the quotient and the remainder of a division at the same time. Dividing by 86400, 3600 and 60 in turn splits the seconds into days, hours, minutes and seconds. Change the numbers for time 1 and time 2 at the top, then run it.

How to write it in LaTeX and other math languages (copy and paste)

Adding and subtracting times (sum and difference)
S = T₁ + T₂,  D = T₁ − T₂
S = T_1 + T_2, \quad D = T_1 - T_2
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>S</mi><mo>=</mo>
    <msub><mi>T</mi><mn>1</mn></msub><mo>+</mo>
    <msub><mi>T</mi><mn>2</mn></msub>
    <mo>,</mo><mspace width="0.7em"/>
    <mi>D</mi><mo>=</mo>
    <msub><mi>T</mi><mn>1</mn></msub><mo>&#x2212;</mo>
    <msub><mi>T</mi><mn>2</mn></msub>
  </mrow>
</math>
S = T_1 + T_2, D = T_1 - T_2
sum = t1 + t2; difference = t1 - t2
S := T1 + T2; difference := T1 - T2;
S = T1 + T2; D = T1 - T2;
S = T_1 + T_2, D = T_1 - T_2
Putting a time into seconds
T = 86400d + 3600h + 60m + s
T = 86400d + 3600h + 60m + s
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>T</mi><mo>=</mo>
    <mn>86400</mn><mi>d</mi>
    <mo>+</mo><mn>3600</mn><mi>h</mi>
    <mo>+</mo><mn>60</mn><mi>m</mi>
    <mo>+</mo><mi>s</mi>
  </mrow>
</math>
T = 86400d + 3600h + 60m + s
totalSeconds = 86400*d + 3600*h + 60*m + s
T := 86400*d + 3600*h + 60*m + s;
T = 86400*d + 3600*h + 60*m + s;
T = 86400d + 3600h + 60m + s
Turning seconds back into days, hours, minutes and seconds (quotient and remainder)
T = 86400q + r
T = 86400q + r
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>T</mi><mo>=</mo>
    <mn>86400</mn><mi>q</mi>
    <mo>+</mo><mi>r</mi>
  </mrow>
</math>
T = 86400q + r
q = Quotient[t, 86400]; r = Mod[t, 86400]
q := iquo(T, 86400); r := irem(T, 86400);
q = floor(T/86400); r = mod(T, 86400);
T = 86400q + r

How to have ChatGPT  do the calculation

You are a time calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

For time 1 "1 day 2 hours 30 minutes 0 seconds" and time 2 "0 days 23 hours 45 minutes 10 seconds", find the sum (time 1 + time 2) and the difference (time 1 − time 2).
Put each into seconds before adding and subtracting, then turn the results back into the form "X days Y hours Z minutes W seconds", carrying at 60 seconds = 1 minute, 60 minutes = 1 hour and 24 hours = 1 day. If the difference is negative, split its absolute value and put a minus sign in front.

Show the code you used, the values in seconds along the way, and the final results.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.