|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2012-11-24 11:17 UTC] pajoye@php.net
-Assigned To:
+Assigned To: derick
[2012-11-24 11:17 UTC] pajoye@php.net
[2016-08-07 09:32 UTC] cmb@php.net
-Status: Assigned
+Status: Duplicate
[2016-08-07 09:32 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
Description: ------------ Calling $dt->modify("Monday this week") for all dates 13–19 May 2012 (Sun–Sat) result in the same date (2012-05-14), suggesting that "this week" runs Sun–Sat. However, calling $dt->modify("Sunday this week") gives the "next" Sunday (2012- 05-20) for the same range. On a related note, the documentation on relative date formats is lacking on the behaviour of this and strtotime when used with locales; one might expect the start of the week to be interpreted from LC_TIME. Test script: --------------- <?php $dt = new DateTime("2012-05-13"); $dt->modify("Sunday this week"); var_dump($dt->format('r')); Expected result: ---------------- string(31) "Sun, 13 May 2012 00:00:00 +0000" Actual result: -------------- string(31) "Sun, 20 May 2012 00:00:00 +0000"