Re: Date problems
| From: | Satyam | Date: | Sun, 09 Apr 2006 09:12:45 +0000 |
| Subject: | Re: Date problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233614@lists.php.net to get a copy of this message | ||
Timestamps are stored as seconds from a certain date. The base date differ depending on the platform, Windows use 1/1/1980 the rest 1/1/1970, but still seconds. 7 days are 7*24*60*60. Just add that much to a timestamp. It helps having a constant such as:
define ('DAY_IN_SECONDS',86400);
Satyam
----- Original Message ----- From: "Mace Eliason" <meliason@shaw.ca>
To: <php-general@lists.php.net>
Sent: Sunday, April 09, 2006 4:14 AM
Subject: [PHP] Date problems
Hi, I am having troubles adding 7 days to the current date. I have been reading through php.net date() and this is what I have come up with but it doesn't work $today = date('m/d/Y'); $nextweek = date('m/d/Y',mktime(date("m"), date("d")+7, date("Y"))); if I echo the above variables they are the same? Shouldn't the $nextweek be different? Thanks for the help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php