Re: strange behaviour with strtotime()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Barry wrote:
> 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



ok i understand now, that is fairly f****d up if you ask me, the
documentation should state this side affect, one month should be one
month from that date not +31 days, if i wated +31 days i would ask for it :)





James



---------------------------------------------------------

Master CIW Designer          http://www.ciwcertified.com
Zend Certified Engineer      http://www.zend.com


http://www.jamesbenson.co.uk

---------------------------------------------------------

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux