Check out example codes for "date difference in minutes java". It will help you in understanding the concepts better.

Code Example 1

long diff = d2.getTime() - d1.getTime();//as given

long seconds = TimeUnit.MILLISECONDS.toSeconds(diff);
long minutes = TimeUnit.MILLISECONDS.toMinutes(diff);

Learn ReactJs, React Native from akashmittal.com