Infinity loop with dates comparison

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 11 12:56:00 PDT 2015


The code look very trivial, but I am getting infinity loop like:
2014-Aug-02
2014-Aug-02
2014-Aug-02
...
2014-Aug-02


Date startDate = Date.fromISOExtString("2014-08-01");

Date currentDate =  to!(Date)(Clock.currTime()-1.days); //because 
current day is not finished

	writeln(startDate);
	writeln(currentDate);

	Date nextday;

	while (nextday < currentDate)
	{
		nextday = startDate + 1.days;
		writeln(nextday);
	}


More information about the Digitalmars-d-learn mailing list