Reputation: 171
ANDROID:
Wanted to know whether is there any API or workaround to know that DAY X + N DAYS ahead or behind was the day that will be / was of next month / previous month.
Upvotes: 0
Views: 278
Reputation: 23010
public static Date getCurrentDatePlusDays(int days) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.DAY_OF_YEAR, days);
Date newDate = calendar.getTime();
return newDate;
}
then check the month or year.
Upvotes: 1