Any help would be appreciated. I have a company that calculates interest where if they have a property for one day in the month of June by July 1st even though it's only been 2 days they get the interest for 2 months. I am having a little trouble figuring out how to do this. Here is what I have which works in some cases but in the case like I mentioned above is there any way for me to figure out month calculation so that if the buy date is 1/29/2018 and it's 3/1/2018 instead of 2 months like mine would calculate it would actually be 3 months interest?
string startDate = "1/15/2018";
DateTime start = Convert.ToDateTime(startDate);
DateTime now = DateTime.Now;
double numberOfDays = (now.Date - start.Date).TotalDays / (365.25 / 12);
double rounded = Math.Round(numberOfDays, 0);
monthsLabel.Text = rounded.ToString();