Logic to Calculate Time Differences

For example, hour minute difference for 3:35pm – 7:20pm

a)First work out, how short of an hour the minutes are in 3:35pm
60 – 35 = 25;
b) Then increment (round-up) 3:35am to closest hour ~ 4:00pm
c) Then work out how many minutes are used within an hour in 7:20pm.
Obvious, but elaborate logic breakdown (20 minutes).
d) Then decrement (round-down) 7:20pm to 7:00pm.

Equation then: (my own logical algorithmic representation)
= 25 + (7:00pm – 4:00pm) + 20
= 25 min + 3 hours + 20 min
= 3:45

Now obviously this is over elaborate as mentioned above in steps and explanation; but in reality, if you stick to the equation, you can work it out on one line in 10 seconds.

Little stupid efficiencies ok! I like it!

Don't be shellfish...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrEmail this to someone

Leave a Reply