[Math] Time Difference and Arithmetic – Suggestions..

arithmetic

I am currently dealing with problems in which I need to find the difference between different times. One trick that worked for me until now was from here a short summary of which is

For Adding Times
Add the hours
Add the minutes
If the minutes are 60 or more, subtract 60 from the minutes and add 1 to hours 

For Subtracting Times
Subtract the hours
Subtract the minutes
If the minutes are negative, add 60 to the minutes and subtract 1 from hours. 

However this trick logically fails when I attempt to subtract

5:00 PM – 12:00 PM (Ans 5 hours)

Also does anyone know how we can calculate differences like (2 AM – 5 PM (Day Before) )
Is the best way to calculate time difference to convert it in 24hr clock first ? I am actually in need of some speedy shortcuts for calculating these differences since I wont have a lot of time on my hands while solving these problems during a standardized test.

Best Answer

If you switch to 24h then it is easy to work in modular arithmetic. In this case the "distance" formula is the following: $$d=(a-b+24) \mod 24=(2-17+24)\mod 24=9$$ The same trick helps with figuring out days of week (mod 7) and music notes (mod 12)