|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-03-22 09:09 UTC] aharvey@php.net
-Package: *General Issues
+Package: Date/time related
[2011-03-22 09:27 UTC] aharvey@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: aharvey
[2011-03-22 09:27 UTC] aharvey@php.net
[2011-03-22 09:33 UTC] aharvey@php.net
[2011-03-22 09:33 UTC] aharvey@php.net
-Status: Assigned
+Status: Closed
[2011-03-22 09:33 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 06:00:01 2025 UTC |
Description: ------------ DateTime::add() method bug Test script: --------------- $date = new DateTime('first day of this month'); echo $date->format('Y-m-d H:i:sP'); $date->add(new DateInterval('P1D')); echo $date->format('Y-m-d H:i:sP'); Expected result: ---------------- 2011-03-01 01:17:31+02:00 2011-03-02 01:17:31+02:00 Actual result: -------------- 2011-03-01 01:17:31+02:00 2011-03-01 01:17:31+02:00 ================= ====== BUT ====== ================= $date = new DateTime('first day of this month'); echo $date->format('Y-m-d H:i:sP'); $date->add(new DateInterval('P1M')); echo $date->format('Y-m-d H:i:sP'); Expected result: ---------------- 2011-03-01 01:17:31+02:00 2011-04-01 01:17:31+02:00 Actual result: -------------- 2011-03-01 01:17:31+02:00 2011-04-01 01:17:31+02:00