Re: Infinity loop with dates comparison

2015-08-11 Thread cym13 via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 19:56:02 UTC, Suliman wrote: 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); //becau

Re: Infinity loop with dates comparison

2015-08-11 Thread anonymous via Digitalmars-d-learn
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 doe

Re: Infinity loop with dates comparison

2015-08-11 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Aug 11, 2015 at 07:56:00PM +, Suliman via Digitalmars-d-learn wrote: [...] > Date startDate = Date.fromISOExtString("2014-08-01"); > > Date currentDate = to!(Date)(Clock.currTime()-1.days); //because current > day is not finished > > writeln(startDate); > writeln(currentD

Infinity loop with dates comparison

2015-08-11 Thread Suliman via Digitalmars-d-learn
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);