Search This Blog

Tuesday, 11 October 2011

Getting Tomorrow Date using Java Example

public class TomorrowDate{
       public static void main(String[] av) {

               Date date = new Date();
               long t = date .getTime();
               t += 1*24*60*60*1000;
               Date tDate= new Date(t);
               SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
               String s = formatter.format(tDate);
               System.out.println("TomorrowDate is "+s);

       }
}