Contact: aviboots(AT)netvision.net.il
39,900 questions
51,831 answers
573 users
function getMonthsBetween2Dates(date1, date2) { return date2.getMonth() - date1.getMonth() + 12 * (date2.getFullYear() - date1.getFullYear()); } console.log(getMonthsBetween2Dates(new Date('2022-02-8'), new Date('2022-11-13'))); /* run: 9 */