jquery go back to previous 6 months from the current date code example
Example: get current month of year in number javascript
var today = new Date();
var month = today.getMonth(); // Returns 9
console.log(month); // Output: 9
var today = new Date();
var month = today.getMonth(); // Returns 9
console.log(month); // Output: 9