I am trying to solve a seemingly simple problem, but I just can’t understand it.
i has two times startTimeand stopTime, which can be considered to be in the format: hh:mm:ss[24hr format].
Now, given the third time - timeToTest- I need to find out if it is timeToTestbetween startTimeand stopTime. No date information other than time.
So, for example, if I have startTime= '22:30:00'and stopTime= '03:30:00', then for timeToTest= the '01:14:23'test should return true.
I tried a solution with java.util.Dateby converting time to milliseconds using getTime(), but with any interval that rolls across the 24-hour barrier, the logic fails.
I am trying to build a solution using Java - but I believe that the logic is language independent.
source
share