Re: AW: [PHP-WIN] CURRENT_DATE + $i ?
| From: | Andrian Pervazov | Date: | Fri, 28 Jul 2000 13:32:03 +0000 |
| Subject: | Re: AW: [PHP-WIN] CURRENT_DATE + $i ? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-1377@lists.php.net to get a copy of this message | ||
Jan-Hendrik Heuing wrote:
>
> Oopps, sorry...
>
> I am using MySQL.
>
In MySQL use the date arithmetic functions DATE_ADD or DATE_SUB.
SELECT DATE_ADD(curdate(), INTERVAL 4 DAY) will give you the date 4 days
from now.
In PHP you can perpform date arithmetic by combining date() and
mktime(). To quote from the manual:
$tomorrow = mktime(0,0,0,date("m") ,date("d")+1,date("Y"));
Andrian