Calculates the time between 2 time intervals in a day.