|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-10-31 00:20 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
I just compiled: php5.4-201110311230 ------------------- desktop7@desktop7-desktop:~/php5.4-201110311230/sapi/cli$ ./php -v PHP 5.4.0RC1-dev (cli) (built: Oct 31 2011 15:21:08) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2011 Zend Technologies ------------------- desktop7@desktop7-desktop:~/php5.4-201110311230/sapi/cli$ ./php /var/www/strto.php 2011-10-30 CONTENT OF STRTO.PHP: <?php date_default_timezone_set('Europe/Madrid'); echo date('Y-m-d',strtotime('2011-10-30')+86400); ?> Thanks for helping me