Re: Date problems
| From: | Rasmus Lerdorf | Date: | Sun, 09 Apr 2006 03:38:13 +0000 |
| Subject: | Re: Date problems | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233602@lists.php.net to get a copy of this message | ||
Rasmus Lerdorf wrote:
Mace Eliason wrote:By the way, the reason your way isn't working is because you have your arguments wrong. The first three arguments to mktime are hour, minute, second, and since you are only printing the date you lose the fact that you added 7 minutes. If you try your script just before midnight you will notice the values are different. -RasmusHi, 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?You are thinking too much! ;) $nextweek = date("m/d/Y",strtotime("+7 days"));