|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-01-16 07:40 UTC] requinix@php.net
-Status: Open
+Status: Duplicate
[2017-01-16 07:40 UTC] requinix@php.net
[2017-02-12 20:20 UTC] derick@php.net
-Status: Duplicate
+Status: Closed
-Assigned To:
+Assigned To: derick
[2017-02-12 20:20 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 20:00:01 2025 UTC |
Description: ------------ As the summary says, $date->modify('Friday this week') doesn't return a Friday if $date is a Sunday. Running the script below on 7.0.14 and 7.0.8 yields 2017-01-02, which is a Monday. However, running the same script on 7.0.5 yields 2017-01-13, a Friday. I expected a Friday. Test script: --------------- <?php $date1 = "2017-01-08"; // this is a Sunday $date = new \DateTime($date1); $date->modify('Friday this week'); $dateFormat = $date->format('Y-m-d'); echo $dateFormat; Expected result: ---------------- Currently, it displays a Monday date on 7.0.14. Testing on 7.0.8 also yields a Monday. I expect to see a Friday date on both PHP 7.0.5, and 7.0.14. Here's another link that tests for all php versions and other base days - https://3v4l.org/ZuOhl