Question: how to calculate difference between time in java?
Answer: getTime(); int minutes = (int) TimeUnit. MILLISECONDS. toMinutes(difference); if(minutes<0)minutes += 1440; Now minutes will be the correct duration between two time (in minute).