Jean,
If you use java.util.GregorianCalendar, it has an add() method to add or
subtract time to the current time stored in the object. Below is a simple
program that adds 5 days to the current time as of when the program has run.
import java.util.GregorianCalendar;
public class TestDate
{
public static void main(String[] args)
{
GregorianCalendar date = new GregorianCalendar();
System.out.println(date.get(GregorianCalendar.DAY_OF_MONTH));
date.add(GregorianCalendar.DAY_OF_MONTH, 5);
System.out.println(date.get(GregorianCalendar.DAY_OF_MONTH));
}
}
References: Java SDK Documentation 1.3.1
-java.util.GregorianCalendar
> hi all
> can any one tell me how to add days to current date?
>
>
> regards
>
> Jean