Re: strange behaviour with strtotime()

From: Date: Tue, 31 Jan 2006 13:12:39 +0000
Subject: Re: strange behaviour with strtotime()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-229534@lists.php.net to get a copy of this message
Ford, Mike wrote:
Because 1 month from 31-Jan is 31-Feb -- which is taken to mean 02-Mar, hence the output of date("M" ...). 2 months from now is 31-Mar, which is ok; 3 months from now would be 31-Apr, which would likewise be taken to mean 01-May. This is all as expected -- no bug here. Cheers! Mike so the 31 feb would be 30 days right?
and since +1 month would be 2nd march wouldnt be +2 month then 2nd april? Sinze its 2nd march +1 month see -> echo strftime("%d %m %Y",strtotime ("+1 Month",mktime(13,0,0,3,2,2006)))."\n"; ^^ gives 2nd april! ^^ echo "date 1:".strftime("%d %m %Y",strtotime ("+1 Month",strtotime("+1 Month")))."\n"; ^^ gives 3rd april ^^ So its not logic. month +2 should output 2nd april! Barry -- Smileys rule (cX.x)C --o(^_^o)

« previous php.general (#229534) next »