CSharp examples for System:DateTime Calculate
All Dates Between as IEnumerable
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from w w w . j av a 2s . c o m*/ public class Main{ static IEnumerable<DateTime> AllDatesBetween(DateTime start, DateTime end) { for (var day = start.Date; day <= end; day = day.AddDays(1)) yield return day; } }