startDate.setTime(validationDate);
endDate.setTime(prevDutyEndDate);
noOfDays=Math.abs((Long)((startDate.getTimeInMillis() - endDate.getTimeInMillis())/(1000 * 60 * 60 * 24)));
In above code snippets startDate is set as March 7th 00:00:00 2018 and endDate is set as March 14th 00:00:00. In CST due day light savings adjustment on March 11th noOfDays calculated is giving 6.95 instead of 7. How can I handle DST adjustment through code and get the value as 7.