i am beginner in java and i wan't to substract to date in java and i wan't diffrence between to date in days.
so for that i have using below approch to solve this
long diff = Math.abs(d1.getTime() - d2.getTime());
long diffDays = diff / (24 * 60 * 60 * 1000);
But this will fail across spring's daylight savings boundary.
Example d1 = new Date(112, 3-1, 11, 0, 0, 0), d2 = new Date(112, 3-1, 12, 0, 0, 0), results in 0.
so please help me to solve this problem. i have also referred Subtract two dates in Java but not getting excat answer that i wan't.
thank you.