Infinity loop with dates comparison
anonymous via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Aug 11 13:05:39 PDT 2015
On Tuesday, 11 August 2015 at 19:56:02 UTC, Suliman wrote:
> Date startDate = Date.fromISOExtString("2014-08-01");
[...]
> Date nextday;
>
> while (nextday < currentDate)
> {
> nextday = startDate + 1.days;
> writeln(nextday);
> }
startDate doesn't change, so every iteration just sets nextday to
2014-08-01 + 1 day = 2014-08-02.
More information about the Digitalmars-d-learn
mailing list