I have been stuck on this issue for the last two days. My issue is this: how can I display the date from one week to another week (Thursday to Thursday)? For example:
<
try this,
String start_date = "01-30-2014"; // Start date
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
Calendar cal = Calendar.getInstance();
try {
c.setTime(sdf.parse(start_date));
} catch (ParseException e) {
e.printStackTrace();
}
cal.add(Calendar.DATE, 7); // number of days to add,in your case its 7
SimpleDateFormat sdf1 = new SimpleDateFormat("dd-MM-yyyy");
String to_date = sdf1.format(cal.getTime());
Actually i don't like android Calendar( I prefer Joda-Time) but above solution should work for you