Friends I am getting two inputs from the user
1.InitDate from DatePicker
2.Difference in between two dates (numberOfDates)
I need to calculate the FinalDate such that
FinalDate=InitDate+numberOfDates
What I have done till now
private void CalcLastDate(int days)
{
long millis=days*24*60*60;
Calendar c = Calendar.getInstance();
c.set(settingsFromDate.getYear(), settingsFromDate.getMonth(), settingsFromDate.getDayOfMonth());
long initDate = c.getTimeInMillis();
long longFinalDate=initDate+millis;
}
Try this:
You can get the your final date with:
And you don’t have to use a third party api.