Just use the following code:
DateTime dateFrom = new DateTime(1982, 8, 23);
DateTime dateTo = new DateTime(2011, 12, 5);
TimeSpan numberOfDaysInterval = dateTo.Subtract(dateFrom);
double daysAgo = numberOfDaysInterval.TotalDays;
string showDays = daysAgo.ToString("0");
This will just output the integer value of the difference of the dates.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment