It might seem a silly question, but how do you define 'date of the previous month'.
It seems to be easy, i.e.: you take the 15th of July, and the previous month it was the 15th of June.
But what do you do on 30th March?
Do you want the last day of February?
Do you want to substract 30 days?
There are different definitions for 'month' in financial sector, and in law.
I found this 30-days solution (but didn't
test it for critical dates):
Perhaps a
java solution using GregorianCalendar will be good.