Re: is this good for date calculation

From: Date: Wed, 14 May 2003 14:15:48 +0000
Subject: Re: is this good for date calculation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147582@lists.php.net to get a copy of this message
On Wed, 14 May 2003 10:13:30 -0700, qt wrote: > echo date ("Y-m-d", strtotime("2003-05-01 +3 days")); If that works, it should be fine... I seems to me like it doesn't but this should..... echo date ("Y-m-d", strtotime("+3 days", strtotime("2003-05-01"))); or as someone else suggested: echo date ("Y-m-d", mktime (0,0,0,5,1+3,2003)); I would probably use the first if the date that I'm trying to add to is coming in from a user defined field (the strtotime function is almost magic) but the second would almost certainly be faster execution time.

« previous php.general (#147582) next »