Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Taking Days away from a Date

Status
Not open for further replies.

Nosh

Programmer
Jul 12, 2001
34
GB
Hi Folks,

Can anyone tell me how to take a number of days away from a date please. I know I can use the Calendar method add to add to a date but how do I take away??

Cheers

Nosh.
 
Hi,

This is one way:

Calendar cal = Calendar.getInstance();
cal.set(Calendar.DATE, Calendar.DATE-15);
System.out.println(cal.getTime());
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top