class TestDate
{
public static void main(String args[])
{
DateFormat myformat = new SimpleDateFormat("MM/dd/yyyy");
String da = myformat.format(new Date());
Date ed = new Date();
try {
Date sd = myformat.parse(da);
da = myformat.format(new Date());
Calendar cal = Calendar.getInstance();
cal.setTime(sd);
int num = 1;
cal.add(Calendar.DATE, num);
ed = cal.getTime();
System.out.println("the privious date is : " + myformat.format(ed));
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
Wednesday, May 13, 2009
Subscribe to:
Post Comments (Atom)
its nice coding in java ...........laukik u r rocking.....
ReplyDelete