|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-11-30 16:46 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Package: date_time
+Package: Date/time related
[2016-11-30 16:46 UTC] cmb@php.net
[2016-12-11 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 19:00:01 2025 UTC |
Description: ------------ You should execute : (new DateTime("2016-11-30"))->add(new DateInterval("P3M")) Result -> 2017-03-02 Then execute : (new DateTime("2016-12-01"))->add(new DateInterval("P3M")) Result -> 2017-03-01 Test script: --------------- if ((new DateTime("2016-11-30"))->add(new DateInterval("P3M")) > (new DateTime("2016-12-01"))->add(new DateInterval("P3M"))) throw new Exception("WTF"); echo "You fixed it";