Re: [PHP4BETA] date formatting
| From: | Michael Waples | Date: | Wed, 23 Feb 2000 07:37:31 +0000 |
| Subject: | Re: [PHP4BETA] date formatting | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10700@lists.php.net to get a copy of this message | ||
> Mike Teigen wrote:
>
> ok, ill try and explain this as well as i can
>
> i need to know how to add 21 days to whatever the current date is to
> make two variables, one being todays date, the other being exactly 21
> days after todays date... how do i add 21 days to todays date??
>
> $currentDate = date("Y-m-d");
> $warningDate = $currentDate + 21;
> (this doesnt work, just using it as a simplified example of what i
> want to do...)
>
> Mikey T
to get + 21 days how about
$newdate = strtotime("+21 days");
echo date( "g:ia l jS F Y", $newdate);
or
$weeks= strtotime("+3 weeks");
echo date( "g:ia l jS F Y", $weeks);