Re: Need help on increment date

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

 



On 24 May 2012, at 08:18, Md Ashickur Rahman Noor wrote:

> I need help to increment date in php. I found this code helpful
> 
> $date = strtotime("+1 day", strtotime("2007-02-28"));
> 
> echo date("Y-m-d", $date);
> 
> 
> But when My date is "2008-02-28" this code give output 2012-03-01. But it
> should  be  2008-02-29. Where I am getting wrong.

Works fine for me: http://dev.stut.net/php/increment_date.php

Have you extracted the above from other code, or are you seeing this behaviour with just those two lines?

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
-- 
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