#34250 [Opn->Bgs]: strtotime("next year") returns +2 years?

From: Date: Thu, 25 Aug 2005 21:55:36 +0000
Subject: #34250 [Opn->Bgs]: strtotime("next year") returns +2 years?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84002@lists.php.net to get a copy of this message
ID: 34250 Updated by: derick@php.net Reported By: gecko at geckzilla dot com -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Linux PHP Version: 5.0.4 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is expected for PHP < 5.1. In PHp 5.1 and 6.0 this will work just fine. The reasoning is that you have: first = 1 next = 2 third = 3 and follows the GNU standards. We did decide to fix this in PHP 5.1 though. Previous Comments: ------------------------------------------------------------------------ [2005-08-25 17:42:59] gecko at geckzilla dot com Description: ------------ Simply expecting for strtotime("next year") to return +1 year instead of +2. Reproduce code: --------------- $nextyear = strtotime("next year"); $now = time(); echo date("F jS Y",$nextyear); echo "<br>"; echo date("F jS Y",$now); Expected result: ---------------- August 25th 2006 August 25th 2005 Actual result: -------------- August 25th 2007 August 25th 2005 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34250&edit=1

« previous php.bugs (#84002) next »