This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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):