How to get the previous month of current date

let new_date = new Date();

               let new_date = new Date(); 
               let year = new_date.getFullYear();
               new_date.setDate(1); 
               new_date.setMonth(new_date.getMonth() - 1);
               let previous_month = new_date.getMonth();

Leave a comment

Your email address will not be published. Required fields are marked *