Hi, I have two times in an array and I need to calculate the difference between both of these. I have converted the hours into mins, then added the remaining mins. This gives me the total minuites overall, once I did this for both I simply minus one total mins from the other. Then converted them back to hours and minuites.
double no1 = Double.parseDouble(array[i][4]);
int time1_calc = (int) (no1 * 100); //Remove decimal point
int time1hours = (time1_calc) / 100;
int time1mins = (time1_calc) % 100;
int time1HM = time1hours*60;
int time1_total = time1HM + time1mins;
The above code is used for the second time, I then use:
int total = time2_total - time1_total;
For this all the calculations "look" to work, but for example the difference betweeen 10.18 and 09.35 is 1hour 23mins or 83mins in total. My program seems to show 43mins.
I have tried other ways but still cannot get it working, any ideas?
Thanks =)