Doc #54456 [Opn->Csd]: date_modify's $modify argument differs from the strtotime's $time argument

From: Date: Fri, 29 Apr 2011 12:21:39 +0000
Subject: Doc #54456 [Opn->Csd]: date_modify's $modify argument differs from the strtotime's $time argument
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6317@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=54456&edit=1 ID: 54456 Updated by: salathe@php.net Reported by: regsd at ya dot ru Summary: date_modify's $modify argument differs from the strtotime's $time argument -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: Windows 7 PHP Version: 5.2.17 -Assigned To: +Assigned To: salathe Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2011-04-29 14:20:24] salathe@php.net Automatic comment from SVN on behalf of salathe Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=310652 Log: added changelog for absolute datetime::modify strings (doc #54456, related r306392) ------------------------------------------------------------------------ [2011-04-28 16:52:28] salathe@php.net This was a bug in DateTime::modify() and is fixed as of PHP 5.3.6. The docs need to be updated to make note of that change. ------------------------------------------------------------------------ [2011-04-03 05:03:17] regsd at ya dot ru Description: ------------ --- From manual page: http://www.php.net/datetime.modify --- Documentation implicitly says that $modify argument of the date_modify function is equal in its meaning to the $time argument of the strtotime function, however they differ. date_modify ignores the time value specified (please see the code snippet below). Test script: --------------- <?php $time = 'next Monday 19:00'; $d = new DateTime('now'); $d->modify($time); echo $d->format('Y-m-d H:i:s') . "\n"; $t = strtotime($time); $d = new DateTime('@'.$t); echo $d->format('Y-m-d H:i:s') . "\n"; ?> Expected result: ---------------- 2011-04-04 13:00:00 2011-04-04 13:00:00 Actual result: -------------- 2011-04-04 08:55:37 2011-04-04 13:00:00 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54456&edit=1

« previous php.doc.bugs (#6317) next »