freeCodeCamp/guide/english/mathematics/adding-and-subtracting-time/index.md

2.0 KiB

title
Adding and Subtracting Time

Adding and Subtracting Time

There are a few basic rules that guide addition and subtraction of time.

Here they are:

60 seconds make 1 minute 60 minutes make 1 hour 1440 minutes make 1 day 24 hours make 1 day 7 days make 1 week 52 weeks make 1 year 365 days make 1 year 366 days make 1 leap year 12 calendar months or 13 lunar months make 1 year

For example, subtracting 1 hour 15 minutes 30 seconds from 4 hours would result in the following

Line 1: 4 00 00 Line 2: 1 15 30 -------- 2 44 30 --------

On Line 1 above, (subtraction and addition) will start from the right most numbers (in this case 00). Deducting 30 from 0 is normally impossible, so what we would do is go the next set of numbers (00) to see if we can borrow. In this case, it's impossible so we go to the next number (leftmost which in this case would be 1 hour- remember 60 minutes make 1 hour).

This is what it would like at this point

3 60 00 1 15 30

Next we need to borrow 1 minute from 60, resulting in what we have below. Remember however that 60 seconds make 1 minute. Reducing 60 by 1 unit results in 59, so we have:

3 59 60 1 15 30

By now we can then make our deductions

60 minus 30 is 30 59 minus 15 is 44 3 minus 1 is 2

Hence subtracting 1 hour 15 minutes 30 seconds from 4 hours would result in 2 hours 44 minutes 30 seconds.

This playful youtube video for kids might also be useful as it goes down to the very basics. https://www.youtube.com/watch?v=HrxZWNu72WI

Let us see an addition example by adding 3 hours 45 minutes 20 seconds to 2 hours 20 minutes 50 seconds

H M S 3 45 20 2 20 50

20 seconds plus 50 seconds is 70 seconds. Recall 60 seconds makes 1 minute. 70 seconds therefore will be 1 minute 10 seconds 45 minutes plus 20 minutes is 65 minutes. Recall 60 minutes is 1 hour. 65 minutes therefore will be 1 hour 5 minutes 3 plus 2 is 5 (hours)

we then need to do the additions.

5 hours + 1 hour 5 minutes + 1 minute 10 seconds would be 6 hours, 6 minutes and 10 seconds.