I use Android Studio. I want to calculate the day after 280 days from the date I specified.
Calendar thatDay = Calendar.getInstance(); //today date
thatDay.set(Calendar.DAY_OF_MONTH,selectedday);
thatDay.set(Calendar.MONTH,selectedmonth-1); // 0-11 so 1 less
thatDay.set(Calendar.YEAR, selectedyear);
Calendar afterday= Calendar.getInstance(); //280 after date
afterday.set(Calendar.DAY_OF_MONTH,selectedday+10);
afterday.set(Calendar.MONTH,selectedmonth+8);
afterday.set(Calendar.YEAR, selectedyear);
Log.e(" After Day: ", " days:" + (afterday.getTimeInMillis()- thatDay.getTimeInMillis())/ (24 * 60 * 60 * 1000));
log output variable. Sometimes 285,283,279 kind of