Contact: aviboots(AT)netvision.net.il
41,467 questions
54,014 answers
573 users
function getMonthsBetween2Dates(date1, date2) { return date2.getMonth() - date1.getMonth() + 12 * (date2.getFullYear() - date1.getFullYear()); } console.log(getMonthsBetween2Dates(new Date('2022-03-9'), new Date('2022-11-18'))); /* run: 8 */