#43169 [Opn]: Wrong date using strtotime('-1 month')
| From: | php at dredzik dot pl | Date: | Thu, 01 Nov 2007 12:37:44 +0000 |
| Subject: | #43169 [Opn]: Wrong date using strtotime('-1 month') | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-119196@lists.php.net to get a copy of this message | ||
ID: 43169
User updated by: php at dredzik dot pl
Reported By: php at dredzik dot pl
Status: Open
Bug Type: Date/time related
Operating System: Windows XP SP/2
PHP Version: 5.2.4
New Comment:
There was very similiar bug to this one reported over 2 years ago, but
since no one seems to have found a solution, I'm resubmitting just to
remind you about it.
Previous Comments:
------------------------------------------------------------------------
[2007-11-01 12:29:07] php at dredzik dot pl
Description:
------------
I use this code to generate timestamp for current and last month and
everything worked fine until yesterday (31 October 2007).
Today everything came back to normal - but when I set the date to
yesterday on my system it keeps getting back.
Reproduce code:
---------------
echo date('Y-m', strtotime('now')) . "\n";
echo date('Y-m', strtotime('-1 month'));
Expected result:
----------------
2007-10
2007-09
Actual result:
--------------
2007-10
2007-10
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43169&edit=1