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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtract dates ( currendate - 7)

Status
Not open for further replies.

TWillard

Programmer
Apr 26, 2001
263
US
I am working with a JSP that will query for last weeks results. I have also been working with Calendar and GregorianCalendar. I see that they contain an add method. However, I have yet to see a subtract method. Does anyone know how to get: Date = currendate - 7;
 
Hi,

The add method works with signed integers so you could try :

aCalendar.add(Calendar.DATE, -7);
--
Globos
 
globos,

Thank you for your reply. I will code this logic into my application first thing this morning.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top