I have two UNIX time stamp and i am using KOTLIN
1) old time - 1534854646 2) current time - 1534857527
Now i want the difference in hours and minutes.
val result = DateUtils.getRelativeTimeSpanString(1534854646, 1534857527, 0)
But it gives me 2 seconds but actual time difference is around 0 hour and 48 minutes.
I have also tried :
long mills = 1534857527 - 1534854646;
int hours = millis/(1000 * 60 * 60);
int mins = (mills/(1000*60)) % 60;
String diff = hours + ":" + mins;
But still it gives 0 hours and 0 minute.