C#: Finding the Number of Days Between Two DateTime Items
One very common requirement is for the number of days elapsed since a particular Date and Time. In C# this can be accomplished through the use of the TimeSpan class.
The easiest way to create a TimeSpan is like this:
TimeSpan tsMySpan = DateTime.Now.Subtract( dtCompareTime );
// The number of days elapsed can be accessed like this:
// tsMySpan.Days