DateTime dtNow = Convert.ToDateTime(string date); int days = DateTime.DaysInMonth(dtNow.Year, dtNow.Month);