If you need a more accurate calculation, that takes internationalization (Culture/Calendar) into account, CodeProject has an excellent article/code-library by Jani Giannoudis: [^
]. This is being developed on GitHub now, and updated for .NET Core, Mono, Xamarin and UWP.
You can examine the (complex) code in the 'DateDiff class to see how total months are calculated.
Another full featured C# library for Date/Time calculations is Jon Skeet's 'NodaTime: [^
] ... on GitHub: [^