I have two dates:
DateTime fromDate = new DateTime(2013,7,27,12,0,0); DateTime toDate = new DateTime(2013,7,30,12,0,0);
I want to iterate fromDate to toDate, incrementing fromDate from one day, and the loop should break when fromDate becomes equal to or greater than toDate. I tried this:
while(fromDate < toDate) { fromDate.AddDays(1); }
But this is an endless cycle and will not stop. How can i do this?
source share