I'm new to using DateTime but I'm wondering if it is able to add every single day between two points to a list dynamically.
For example, my code looks like this:
{
startTime = new DateTime(startYear, startMonth, startDay);
endTime = new DateTime(endYear, endMonth, endDay);
TimeSpan elapsed = endTime.Subtract(startTime);
startString = startDay.ToString();
elapsedString = elapsed.TotalDays.ToString();
}
Through this I can return the total amount of days between two points. However, elapsed.TotalDays.ToString();
only returns the total amount of days between two points. What I'm wondering is if it is possible to return every single day between two points and place it into a list?