Bug #12474: possible incorrect strtotime handling of "-1Month"
| From: | jbarrett at australink dot net | Date: | Tue, 31 Jul 2001 00:53:49 +0000 |
| Subject: | Bug #12474: possible incorrect strtotime handling of "-1Month" | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-61607@lists.php.net to get a copy of this message | ||
From: jbarrett@australink.net
Operating system: Linux (should happen on any)
PHP version: 4.0.4pl1
PHP Bug Type: Date/time related
Bug description: possible incorrect strtotime handling of "-1Month"
when running
<?PHP
print date("d/m/Y", strtotime("31 July 2001"))."\n";
print date("d/m/Y", strtotime("-1 month", strtotime("31 July
2001")))."\n";
?>
it replies with
X-Powered-By: PHP/4.0.3pl1
Content-type: text/html
31/07/2001
01/07/2001
of course what it's doing is turning it into 31 june which is then being
considered to be the 1 of july.. Should this be right or should strtotime
realise that there are 30 days in june and truncate the "31st" day?
--
Edit bug report at: http://bugs.php.net/?id=12474&edit=1