Contact: aviboots(AT)netvision.net.il
39,870 questions
51,793 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 */