Custom Search

Monday 27 August 2012

Java Program that add n or 100 number of days to the current date & display new date & time

Java Program that add n or 100 number of days to the current date & display new date & time

Program

import java.util.*;
class Add100days
{
public static void main(String args[])
{
Date date=new Date();
long msec=date.getTime();
msec+=100*24*60*60*1000L;
date.setTime(msec);
System.out.println(date)
}
}

No comments:

Post a Comment

Laptops