Doc #72514 [Ver]: Behaviour of relative date format "this week" has changed
| From: | cmb@php.net | Date: | Sun, 03 Jul 2016 22:55:54 +0000 |
| Subject: | Doc #72514 [Ver]: Behaviour of relative date format "this week" has changed | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13680@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72514&edit=1
ID: 72514
Updated by: cmb@php.net
Reported by: roelharbers at gmail dot com
Summary: Behaviour of relative date format "this week" has
changed
Status: Verified
Type: Documentation Problem
Package: Date/time related
Operating System: Ubuntu, OSX
PHP Version: 5.6.23
-Assigned To: tyrael
+Assigned To: ab
Block user comment: N
Private report: N
New Comment:
Thanks, Ferenc. Antol, can you also please fix the NEWS and the
Changelog of PHP 7.0?
Previous Comments:
------------------------------------------------------------------------
[2016-07-03 22:44:14] tyrael@php.net
for the record the NEWS entry is there, but was added to the wrong php version (5.6.21), while in https://bugs.php.net/bug.php?id=63740 it was
communicated as it will present in 5.6.22 (which did not happen as the commit was made after
5.6.22RC1 was tagged) while actually it was released in 5.6.23.
I've updated the NEWS in PHP-5.6 and the Changelog.
------------------------------------------------------------------------
[2016-06-29 11:47:20] cmb@php.net
I've added a changelog entry to the "Relative Formats" section.
Ferenc, can you please add the missing NEWS and Changelog entries?
------------------------------------------------------------------------
[2016-06-29 11:44:52] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=339521
Log: Fix #72514: Behaviour of relative date format "this week" has changed
------------------------------------------------------------------------
[2016-06-29 11:36:31] cmb@php.net
Behavioral change confirmed: <https://3v4l.org/R4T5a>.
Apparently,
this week is a shortcut for Monday this week, and the date
extension assumes monday to be the first day of the week.
Thus, the behavior before PHP 5.6.23 has to be regarded as a bug,
what has been reported as bug #63740, and recently been fixed[1].
Even though this commit added a NEWS entry, this did neither make
it into the PHP 5.6.23 NEWS[2] nor the Changelog[3] nor to the
NEWS/Changelog of later versions.
[1] <https://github.com/php/php-src/commit/f43f6fc3>
[2] <https://github.com/php/php-src/blob/php-5.6.23/NEWS>
[3] <http://php.net/ChangeLog-5.php#5.6.23>
------------------------------------------------------------------------
[2016-06-29 10:00:35] roelharbers at gmail dot com
Description:
------------
In php v5.6.22, the relative date format "this week" returns the next monday when called
on a sunday date.
In php v5.6.23, it returns the previous monday.
It might be that the new behaviour is better, however, I find no mention of this backward
compatibility breaking change in the changelog.
Test script:
---------------
for v in 5.6.22 5.6.23; do ( echo $v: ; docker run --rm php:$v php -r
'date_default_timezone_set("UTC");echo (new
DateTime("2016-06-19"))->modify("this
week")->format("c")."\n";') done
Expected result:
----------------
I expect both versions to return the same.
Actual result:
--------------
5.6.22:
2016-06-20T12:00:00+00:00
5.6.23:
2016-06-13T12:00:00+00:00
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72514&edit=1