Re: [PHP4BETA] date formatting
| From: | David Robley | Date: | Wed, 23 Feb 2000 07:03:13 +0000 |
| Subject: | Re: [PHP4BETA] date formatting | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10697@lists.php.net to get a copy of this message | ||
> On 22 Feb, 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
>
> The time function is where you could start. Use
>
> $newtime = time() + 86400;
Of course, I meant to say
$newtime = time() + (21 * 86400);
-
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA