Calendar cal = new GregorianCalendar();
If I want to know the date after 3 days from "cal", is there a way to compute that? Thanks. Can the add(int field, int amount) method do that?
Calendar cal = new GregorianCalendar();
If I want to know the date after 3 days from "cal", is there a way to compute that? Thanks. Can the add(int field, int amount) method do that?
If I understand your question, then yes. Using Calendar.DAY_OF_MONTH
Calendar cal = new GregorianCalendar();
cal.add(Calendar.DAY_OF_MONTH, 3);
Indeed, you can get the date from a Calendar
object:
Calendar cal = new GregorianCalendar()
Date d;
cal.add(Calendar.DATE, 3);
d = cal.getTime();