C# Developer Blog
Monday, February 15, 2010
Getting months between two dates
DateTime dt1 = DateTime.Parse("15-04-2010");
DateTime dt2 = DateTime.Parse("15-09-2007") ;
int months = dt1.Month - dt2.Month;
int years = dt1.Year - dt2.Year;
months += years * 12;
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)