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();
// 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
Post a Comment