I had try to get day different between two specific date using below code but the same date passed in return a different value for android below and above android 6.0
here is my function to get the day count:
Calendar cal = Calendar.getInstance();
Calendar base_cal = Calendar.getInstance();
baseDate = chineseDateFormat.parse("1900-1-3");
base_cal.setTime(baseDate);
int offset = (int) ((cal.getTimeInMillis() - base_cal.getTimeInMillis()) / 86400000L);
I realized that the cal.getTimeInMillis() can return the same value for different os version but base_cal.getTimeInMillis() will return different value for different android os version and it always different by one day