So i've done this code to get the time passed between the current date and another date but it always returns only the difference in minutes for example i want to subtract 10/5/2019,20:30 from 11/5/2019,20:50 it only returns 20 which is the number of minutes that passed but it dosen't give the whole difference with days and everything
here what my code looks like
Date datee = new Date();
SimpleDateFormat df1 = new SimpleDateFormat("dd MMM YYYY, HH:mm");
String currentdate = df1.format(datee);
String dateStr = msg.getDate();
try {
Date messageDate = df1.parse(dateStr);
Date currentDate = df1.parse(currentdate);
long dif = (currentDate.getTime() - messageDate.getTime())/60000;
holder.dateTextView.setText(String.valueOf(dif));
} catch (ParseException e) {
e.printStackTrace();
}
and thanks !