I have two dates variable. How to calculate Date Difference in Java?
You can use the Calendar class for calculating the date difference in Java.
Get data into milliseconds like this:
long milliseconds1 = calendar1.getTimeInMillis();
And then easily find the date difference.
Check tutorial Date Difference.