var dt = new Date('13 June 2013'); dt.setMonth(dt.getMonth()-1)
Then you can use this code snippet this answer to convert it to YYYYMMDD
Date.prototype.yyyymmdd = function() { var yyyy = this.getFullYear().toString(); var mm = (this.getMonth()+1).toString();
Something needs to be careful. If you are in March 31 and subtract a month, what happens? You can not get February 31! See this for more details.
source share