Difference in seconds between two times
Im trying to create a simple Java program that takes in two times in the format "HH MM SS" and then calculate the difference between these times in seconds.
To keep things simple, i'm just using two string values to hold the times so I can concentrate on the part of the code which does the calculation.
In other languages this would be an easy task but in Java, it seems very complicated. Can anyone help out at all?
Things to bear in mind:
Difference between 17 50 05 and 17 51 05 = 60 seconds
Difference between 17 50 05 and 17 49 05 = 60 seconds (not -60)