As for leap years, the rule is:
In reply to Re^2: How to get last month date period by bart in thread How to get last month date period by roborat