|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68603 "Monday this week" works (wrongly) on Sunday starting weeks.
Submitted: 2014-12-14 11:29 UTC Modified: 2016-08-07 09:39 UTC
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:1 (25.0%)
From: Assigned: cmb (profile)
Status: Duplicate Package: Date/time related
PHP Version: 5.6.3 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2014-12-14 11:29 UTC]
The note at describes:

We can now do thing like this with strtotime:
$weekMondayTime = strtotime('Monday this week');
However this works based on a week starting Sunday.  I do not know if we can tweak this PHP behavior, anyone know?

But it really should use Monday starting weeks.

Test script:
$weekMondayTime = strtotime('Monday this week');
echo date('Y-m-d h:i:s', $weekMondayTime), "\n";

Expected result:
2014-12-08 12:00:00

Actual result:
2014-12-15 12:00:00


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-07 09:39 UTC]
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2016-08-07 09:39 UTC]
This is actually a duplicate of bug #63740, which has been fixed
as of PHP 5.6.23 and 7.0.8, respectively (see
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 02:01:28 2024 UTC