Android get date after 7 days

Date currentDay = new Date();
// Add milliseconds to your current day
Date seventhDay = new Date 
(currentDay.getTime + 604800000L); // 7*24*60*60*1000


or Use the calendar api
Calendar calendar = Calendar.getInstance();
calendar.setTime(myDate);
calendar.add(Calendar.DAY_OF_YEAR, 7);
Date seventhDay = calendar.getTime();

Comments

Popular posts from this blog

Input filter (space not allowed) for EditText

Android Versions details

English - Formal and Informal words