java - How to get hour and minutes difference from two localtime joda -
i want difference between 2 localtime values in hours , minutes? suppose want time difference between 6pm , 11.59 am, ie, 5.59 (5 hours , 59minutes).
localtime starttimeonlyest = new localtime(starttimeest); localtime endtimeonlyest = new localtime(endtimeest); float quotient = minutes.minutesbetween(starttimeonlyest, endtimeonlyest).getminutes() / 60;
by using above code, hour value 5..i want .59 also. can me?
int total_minutes = minutes.minutesbetween(starttimeonlyest, endtimeonlyest).getminutes(); int hours = total_minutes / 60; int minutes = total_minutes % 60;
Comments
Post a Comment