Subtracting the past date from the current date will give you the number of days. After that it’s mainly a question of how you define a month. Dividing the days by 30 might be one solution. If you are counting calendar months, do you count the interval from Dec 31 to Jan 1 as one month? If so, you could multiply the years by 12, add the months and subtract i.e.
CurrentYear*12 + CurrentMonth - (PastYear*12 + PastMonth)