Edit report at https://bugs.php.net/bug.php?id=60176&edit=1

 ID:                 60176
 Updated by:         f...@php.net
 Reported by:        sombra2eternity at gmail dot com
 Summary:            date + strtotime fails to calculate date
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Date/time related
 Operating System:   Ubuntu
 PHP Version:        5.3.8
 Block user comment: N
 Private report:     N

 New Comment:

I can't reproduce this with PHP_5_3 HEAD.

Could you please check that your "date.timezone" is set correctly in your 
php.ini?

It could help to compare "Y-m-d H:i:s" output.


Previous Comments:
------------------------------------------------------------------------
[2011-10-31 00:20:04] sombra2eternity at gmail dot com

Description:
------------
Dont know if corrected in new versions but I cant actually upgrade so I write 
it here anyway to be sure its reported.

Strtotime/date fails to get the date in a simple test.

I think I found a bug:

echo date("Y-m-d",strtotime('2011-10-30')+86400);
//returns 2011-10-30 and should return 2011-10-31

desktop7@desktop7-desktop:~$ php -v
PHP 5.3.5-1ubuntu7.3 with Suhosin-Patch (cli) (built: Oct 13 2011 21:56:07) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Test script:
---------------
echo date("Y-m-d",strtotime('2011-10-30')+86400);

Expected result:
----------------
2011-10-31

Actual result:
--------------
2011-10-30


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



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60176&edit=1

Reply via email to