Home » U++ Library support » U++ Callbacks and Timers » Date iterator
|
|
Re: Date iterator [message #27484 is a reply to message #27482] |
Tue, 20 July 2010 11:32 |
mr_ped
Messages: 825 Registered: November 2005 Location: Czech Republic - Praha
|
Experienced Contributor |
|
|
ratah wrote on Tue, 20 July 2010 11:16 |
Date datetmp, datemin(2009, 12, 31), datemax(2010, 12, 31);
for(datetmp = datemin; datetmp < datemax; datetmp.day++)
{
...
}
|
See TimeDate.h with Date definition:
Date& operator+=(Date& a, int b);
instead of datetmp.day++ (which does post-increment only day, not whole date), just do:
Date datetmp, datemin(2009, 12, 31), datemax(2010, 12, 31);
for(datetmp = datemin; datetmp < datemax; datetmp += 1 )
{
...
}
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 29 08:26:54 CEST 2024
Total time taken to generate the page: 0.01682 seconds
|