|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-08-19 17:07 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2014-08-19 17:07 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 08:00:02 2026 UTC |
Description: ------------ subsription of months does not work well for the last day of month Test script: --------------- $date = new \DateTime(); $date->setDate(2014, 7, 31); $date->setTime(0,0,0); print($date->format('Y-m-d'))."\n"; $date->sub(new \DateInterval('P1M')); print($date->format('Y-m-d'))."\n"; ->> 2014-07-31 ->> 2014-07-01 must be 2014-06-30 $date->setDate(2014, 8, 31); ->> 2014-08-31 ->> 2014-07-31 ok