Bug #43452 [Com]: strtotime returns wrong date when requested day is same as first day of the mon

From: Date: Thu, 01 Oct 2020 16:50:28 +0000
Subject: Bug #43452 [Com]: strtotime returns wrong date when requested day is same as first day of the mon
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229323@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=43452&edit=1

 ID:                 43452
 Comment by:         dwatts at dimentech dot com
 Reported by:        sean dot thorne at gmail dot com
 Summary:            strtotime returns wrong date when requested day is
                     same as first day of the mon
 Status:             Closed
 Type:               Bug
 Package:            Date/time related
 Operating System:   *
 PHP Version:        5.2CVS-2008-10-21
 Assigned To:        derick
 Block user comment: N
 Private report:     N

 New Comment:

I stumbled onto this while searching for an answer. I'm using PHP v7.2.33 and am seeing this
error.

echo date('Y-m-d', strtotime('first Thursday October 2020')); echo
"<br>";
echo date('Y-m-d', strtotime('first Friday October 2020')); echo
"<br>";

2020-10-08
2020-10-02


Previous Comments:
------------------------------------------------------------------------
[2015-12-25 12:36:55] cmb@php.net

Related To: Bug #63227

------------------------------------------------------------------------
[2008-11-02 13:24:35] derick@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

I merged this last weekend, so closing.

------------------------------------------------------------------------
[2008-11-02 13:17:52] jani@php.net

Derick, this bug has obviously been fixed in PHP_5_2. As it has been 
a bugfix why isn't it committed to PHP_5_2?!

------------------------------------------------------------------------
[2008-10-21 12:05:00] jani@php.net

Derick, feedback was given..

------------------------------------------------------------------------
[2008-10-16 23:18:39] till@php.net

Confirmed it broken in 5.2.7-dev as well.

Since it appears to be fixed in 5.3-alpha3-dev, is there any chance this fix can be backported?

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=43452


--
Edit this bug report at https://bugs.php.net/bug.php?id=43452&edit=1


Thread (18 messages)

« previous php.bugs (#229323) next »