Working on Java 7, i have the following String date = "12/04/2012".
I converted the String to a Date format:
Date date_converted = DateUtils.parse(DateUtils.STANDARD, date);
Now i want to add a day to my Date, someone can help me?
Working on Java 7, i have the following String date = "12/04/2012".
I converted the String to a Date format:
Date date_converted = DateUtils.parse(DateUtils.STANDARD, date);
Now i want to add a day to my Date, someone can help me?
Calendar cal = Calendar.getInstance();
cal.setDate(date_converted);
cal.add(Calendar.Date, numberOfDays);
date_converted = cal.getTime();
The above is the easiest way of doing it in Java 7. You can easily subtract days by passing negative number.