DateTime d1 = new DateTime(2002, 1, 1);
DateTime d2 = new DateTime(2000, 10, 1);
int M = Math.Abs((d1.Year - d2.Year));
int months = ((M * 12) + Math.Abs((d1.Month - d2.Month)));
Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 250 SHARP for every blog they publish.
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegisterMembers onlyeBook · Learn .NETCSharp 13 and .NET 9 Scripting Guide (Run .cs Without Projects)Download nowWrite a blog post and earn +250 SHARP when it is approved.
Write a blog
narayan bankePosted Aug 19, 2010, 9:19 PM EDT
Good Day