From: nick at netdupe dot com Operating system: Mac OS X 10.4 PHP version: 5.0.4 PHP Bug Type: Date/time related Bug description: strtotime - 'next month' doesn't work.
Description: ------------ This bug is fairly self explanatory. But for those who need things to be explained, basically if you enter "next month" into strtotime you would expect it to give the current time + one month, but it gives the current time + 2 months. Tried on several machines same result, seems to have the same effect in 5.0.3. I believe there are also problems with 'next week' etc etc. './configure' '--prefix=/usr/local/php5' '--with-config- file-path=/usr/local/php5/lib' '--with-apxs' '--with-iconv' '--with-openssl=/usr' '--with-zlib=/usr' '--with-mysql=/ Users/marc/svn/entropy/php-module/src/mysql-standard-*' '-- with-mysqli=/usr/local/mysql/bin/mysql_config' '--with- libxml-dir=/usr/local/php5' '--with-xsl=/usr/local/php5' '-- with-pdflib=/usr/local/php5' '--with-pgsql=/Users/marc/svn/ entropy/php-module/build/postgresql-build' '--with-gd' '-- with-jpeg-dir=/usr/local/php5' '--with-png-dir=/usr/local/ php5' '--with-zlib-dir=/usr' '--with-freetype-dir=/usr/ local/php5' '--with-t1lib=/usr/local/php5' '--with-imap=../ imap-2002d' '--with-imap-ssl=/usr' '--with-gettext=/usr/ local/php5' '--with-ming=/Users/marc/svn/entropy/php-module/ build/ming-build' '--with-ldap' '--with-mime-magic=/usr/ local/php5/etc/magic.mime' '--with-iodbc=/usr' '--with- xmlrpc' '--with-expat-dir=/usr/local/php5' '--with-iconv- dir=/usr' '--with-curl=/usr/local/php5' '--enable-exif' '-- enable-wddx' '--enable-soap' '--enable-sqlite-utf8' '-- enable-ftp' '--enable-sockets' '--enable-dbx' '--enable- dbase' '--enable-mbstring' '--enable-calendar' '--with-bz2=/ usr' '--with-mcrypt=/usr/local/php5' '--with-mhash=/usr/ local/php5' '--with-mssql=/usr/local/php5' '--with-fbsql=/ Users/marc/svn/entropy/php-module/build/frontbase-build/ Library/FrontBase' '--enable-openbase_module' Reproduce code: --------------- <?php echo date('F j, Y, g:i a'); echo date('F j, Y, g:i a', strtotime('next month')); ?> Expected result: ---------------- May 12, 2005, 5:42 pm June 12, 2005, 5:42 pm Obviously the dates will be different when you do this. Actual result: -------------- May 12, 2005, 5:42 pm July 12, 2005, 5:42 pm -- Edit bug report at http://bugs.php.net/?id=33013&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33013&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33013&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33013&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33013&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33013&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33013&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33013&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33013&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33013&r=support Expected behavior: http://bugs.php.net/fix.php?id=33013&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33013&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33013&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33013&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33013&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33013&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33013&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33013&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33013&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33013&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33013&r=mysqlcfg