Calculating difference in two time
calendar, datetime, java
Solution
I'm not sure it is helpful here, but Joda Time seems to have a little more verbose solution using Period e.g.
Period p = new Period(startDate, endDate)
int minutes = p.getMinutes(); //returns the left over minutes part
int seconds = p.getSeconds(); //returns the seconds part
I'm not sure that for this particular case you need something else than what you have, I agree with aix's
Problem
I am calculating the difference between two times and i am able to get the difference in hours and minuted using separate equations,is there any single equation from which i can get hours and minutes at one go.I am using like: here diff is the difference between two time value ``` long diffHours1 = diff / (60 * 60 * 1000); long min=diff/(60*1000); ```