note 14822 added to ref.datetime.php
| From: | bderix at web dot de | Date: | Thu, 16 Aug 2001 09:20:01 +0000 |
| Subject: | note 14822 added to ref.datetime.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16791@lists.php.net to get a copy of this message | ||
Simple addDays function: add $days to a typical $datetime value (see return).
function addDays($datetime, $days) {
$dd = strtotime($datetime);
$dd2 = $dd + 3600*24*$days;
return date("Y-m-d H:i:s", $dd2);
}
http://www.php.net/manual/de/ref.datetime.php