note 79691 added to function.date-modify
| From: | matthijs at yourmediafactory dot com | Date: | Sat, 08 Dec 2007 12:38:44 +0000 |
| Subject: | note 79691 added to function.date-modify | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132953@lists.php.net to get a copy of this message | ||
I have trouble finding the documentation for the dateTime object, but this seems to work:
<?php
$currentDate = new DateTime('2008-01-04');
$endDate = new DateTime('2009-01-04');
while($currentDate < $endDate) {
echo $currentDate -> format('Y-m-d') . ' till ';
$currentDate -> modify('+1 week');
echo $currentDate -> format('Y-m-d') . ' <br />';
}
?>
This will (obviously) print a list of date-ranges between startdate and enddate.
----
Server IP: 213.249.64.162
Probable Submitter: 82.73.191.141
----
Manual Page -- http://www.php.net/manual/en/function.date-modify.php
Edit -- https://master.php.net/note/edit/79691
Del: integrated -- https://master.php.net/note/delete/79691/integrated
Del: useless -- https://master.php.net/note/delete/79691/useless
Del: bad code -- https://master.php.net/note/delete/79691/bad+code
Del: spam -- https://master.php.net/note/delete/79691/spam
Del: non-english -- https://master.php.net/note/delete/79691/non-english
Del: in docs -- https://master.php.net/note/delete/79691/in+docs
Del: other reasons-- https://master.php.net/note/delete/79691
Reject -- https://master.php.net/note/reject/79691
Search -- https://master.php.net/manage/user-notes.php