Edit report at http://bugs.php.net/bug.php?id=51505&edit=1
ID: 51505 Updated by: [email protected] Reported by: marcus at betoptions dot com Summary: strotime incorrect when looking at days this week or last -Status: Open +Status: Bogus Type: Bug Package: Date/time related Operating System: Linux PHP Version: 5.2.13 New Comment: Yes, we made strtotime() a bit smarter in 5.3. Since there is a chance of a backward-compatibility break here, we can't fix this in the 5.2 tree. Previous Comments: ------------------------------------------------------------------------ [2010-04-08 05:35:54] marcus at betoptions dot com Description: ------------ When using strtotime to determine the date of a particular day last week or next week using a given value for $now we get results that we would not be expecting. I get the values I am expecting when using PHP 5.3.2 Test script: --------------- $time = mktime(0, 0, 0, 4, 7, 2010); echo date('Y-m-d H:i:s', strtotime('Tuesday last week', $time)); echo "\n"; echo date('Y-m-d H:i:s', strtotime('Tuesday this week', $time)); Expected result: ---------------- 2010-03-30 00:00:00 2010-04-06 00:00:00 Actual result: -------------- 2010-04-06 00:00:00 2010-04-13 00:00:00 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51505&edit=1
