subtracting days from GregorianCalendar
How does one subtract, let's say, 7 days from a given GregorianCalendar instance. Let's say I want to set up two instances on GregorianCalendar. The first one has a known date, like so:
int endYear = 2005;
int endMonth = 7;
int endDay = 6;
GregorianCalendar endDate = new GregorianCalendar();
How do I set up a second instance of GregorianCalendar set to 7 days prior to the endDate instance?
GregorianCalendar nearDate = new GregorianCalendar();
What I want to do here is make a comparison with todays date (a third instance of GregorianCalendar that is set to todays date), to see if todays date is within the range between endDate and nearDate.
Can someone please help?
Check out the methods add(), after() and before().
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL