This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello, Could someone help me out with the code to get the date for one month ago(last month)...and how would i account for the date rollover(when the year changes) i would really appreciate it..thanks..
Example: Consider a GregorianCalendar originally set to August 31, 1999. Calling roll(Calendar.MONTH, 8) sets the calendar to April 30, 1999. Using a GregorianCalendar, the DAY_OF_MONTH field cannot be 31 in the month April. DAY_OF_MONTH is set to the closest possible value, 30. The YEAR field maintains the value of 1999 because it is a larger field than MONTH.
[ July 09, 2003: Message edited by: Joel McNary ]
Joined: Jun 16, 2003
Hey Joel, You are right..I'm sorry but i don't think i was clear about my response..i was talking about changing month...thats what i used roll() for..