I'm aware of calculating number of days between two dates.
Java, Calculate the number of days between two dates
But i'm not able to understand how the calculation is made in below piece of code. Particularly the one which is highlighted below.
return (int)( (d2.getTime() - d1.getTime()) / (
1000*
60*
60*
24));
Kindly let me know the logic behind this.