Doc #67722 [Asn->Csd]: first day returning first day of next month
| From: | salathe@php.net | Date: | Thu, 31 Jul 2014 13:37:15 +0000 |
| Subject: | Doc #67722 [Asn->Csd]: first day returning first day of next month | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-11404@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67722&edit=1
ID: 67722
Updated by: salathe@php.net
Reported by: fabio at app-roved dot com
Summary: first day returning first day of next month
-Status: Assigned
+Status: Closed
Type: Documentation Problem
Package: Date/time related
Operating System: SLES 11
PHP Version: 5.5.15
Assigned To: salathe
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2014-07-31 13:11:10] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&revision=334439
Log: start a changelog for datetime.formats.relative (doc bug #67722)
------------------------------------------------------------------------
[2014-07-31 12:11:22] salathe@php.net
From Derick in bug #51096:
"first day" and "last day" should be "+1 day" and "-1
day".
The documentation should be updated to reflect this behaviour, as currently the "first/last day
of" section says the "of" is optional when it is not.
------------------------------------------------------------------------
[2014-07-31 09:25:38] fabio at app-roved dot com
Description:
------------
The documentation of "first day" says "Sets the day of the first of the current
month." (http://php.net/manual/de/datetime.formats.relative.php), but it will return sometimes
the first day of the next month.
For 2014-07-30 it returns 2014-07-01
For 2014-07-31 it returns 2014-08-01
For 2014-08-01 it returns 2014-08-01
There's a related bug which fixed a similiar issue in PHP 5.3
(https://bugs.php.net/bug.php?id=53778)
Test script:
---------------
<?php
$currentMonthDate = new DateTime("2014-07-31 10:26:00.000000");
echo $currentMonthDate->format('Ym');
$currentMonthDate->modify('first day');
echo $currentMonthDate->format('Ym');
?>
Expected result:
----------------
201407
201407
Actual result:
--------------
201407
201408
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67722&edit=1