I'm just now reading this thread — not sure how I missed it before. Doesn't this do what you want for getting "previous month"?
Code:
date -d "last month" "+%Y%m"
Why are you getting the current month, setting it to the 15th, and then asking for last month? Is your system doing something weird on the 1st or maybe has an unwanted time zone set somewhere?