Contact: aviboots(AT)netvision.net.il
41,604 questions
54,252 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 */