Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Loop through dates Re: Loop through dates

#127591
ajnoguerra
Participant

$date = new DateTime(); // Without argument: now
$interval = new Dateinterval(“P1D”); // Period: 1 day
for ($i = 0; $i <= 5; $i++) {
echo $date->format(“Y-m-d”).”n”;
$date->add($interval);
}