Re: [PHP4BETA] date formatting

From: Date: Wed, 23 Feb 2000 06:42:41 +0000
Subject: Re: [PHP4BETA] date formatting
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-10694@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; and $newtime will be +21 days to the second :-) Then you can format it with date() as needed. Cheers -- 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

« previous php.version4 (#10694) next »