RE: [PHP] adding days to a given date
| From: | Hawkes, Richard | Date: | Wed, 31 Mar 2004 09:14:39 +0000 |
| Subject: | RE: [PHP] adding days to a given date | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-181912@lists.php.net to get a copy of this message | ||
What else can it do other than convert dates to time strings Jason?
-----Original Message-----
From: Jason Wong [mailto:php-general@gremlins.biz]
Sent: 31 March 2004 10:13
To: php-general@lists.php.net
Subject: Re: [PHP] adding days to a given date
On Wednesday 31 March 2004 17:08, Hawkes, Richard wrote:
> You'll want to do something like this:
>
> $timeStamp = strtotime("2004-04-29");
> $timeStamp += 24 * 60 * 60 * 7; // (add 7 days)
> $newDate = date("Y-m-d", $timeStamp);
>
> The 'strtotime' function converts all sorts of standard dates to the Unix
> Epoch seconds (seconds since 1/1/1970). You then just add the required
> seconds!
strtotime() can do more than that, time to RTFM.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
QOTD:
"My life is a soap opera, but who gets the movie rights?"
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================