Tag Archives: date loop

5 cents hint – c# looping between date range

If you need looping between date range then there are many ways to solve this task. Here is one simple code snippet DateTime startDate = new DateTime(2017, 1, 1); DateTime endDate = DateTime.Today; // looping between date range while (startDate < endDate) { // … to the “thing” startDate = startDate.AddDays(1); } Mission completed.