|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-08-19 16:02 UTC] levim@php.net
-Assigned To:
+Assigned To: derick
[2014-08-19 17:14 UTC] requinix@php.net
-PHP Version: 5.4.31
+PHP Version: 5.4.30, 5.5.14
[2014-08-20 09:42 UTC] derick@php.net
[2014-08-20 09:43 UTC] derick@php.net
-Status: Assigned
+Status: Feedback
[2014-11-10 16:00 UTC] lowwa132 at free dot fr
[2014-12-30 10:42 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
Description: ------------ The following code: ``` <?php $dt = new DateTime(); $dt->setTimestamp(1234567890); var_dump($dt->modify('4 year')); ``` results in the following in php 5.4.29: ``` object(DateTime)#1 (3) { ["date"]=> string(19) "2013-02-14 00:31:30" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } ``` but in php 5.4.30 and 5.4.31: ``` object(DateTime)#1 (3) { ["date"]=> string(26) "2013-02-14 00:31:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } ``` Test script: --------------- <?php $dt = new DateTime(); $dt->setTimestamp(1234567890); var_dump($dt->modify('4 year')); Expected result: ---------------- object(DateTime)#1 (3) { ["date"]=> string(19) "2013-02-14 00:31:30" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Actual result: -------------- object(DateTime)#1 (3) { ["date"]=> string(26) "2013-02-14 00:31:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }