|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-02-11 17:34 UTC] timakeeling at gmail dot com
[2016-08-07 09:29 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2016-08-07 09:29 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 03:00:01 2025 UTC |
Description: ------------ the problem is: in sunday code output date for Monday next week $date = new DateTime(); $date->setTimezone(new DateTimeZone('Europe/Moscow')); $date->setTimestamp(strtotime('Monday this week')); echo $date->format("d.m.Y"); but in other days (except Sunday) its return correct value of Monday. I ever set locale manualy , which has a monday - the first day of week, but PHP "think" the Sunday is still firs day. is it bug ?? or i do some wrong ? for check this you need to set you local time in any Sunday. Test script: --------------- $date = new DateTime(); $date->setTimezone(new DateTimeZone('Europe/Moscow')); $date->setTimestamp(strtotime('Monday this week')); echo $date->format("d.m.Y"); Expected result: ---------------- The value on this week Monday. for example in Sunday of 10.02.2012 i expect to see 04.02.2012. Actual result: -------------- if i test this code at Sunday 10.02.2012 - actual result is 11.02.2012 - it's wrong because this is a next week