#51096 [NEW]: strtotime returns wrong results
| From: | phpbugs at rizzt dot kicks-ass dot org | Date: | Sat, 20 Feb 2010 15:18:08 +0000 |
| Subject: | #51096 [NEW]: strtotime returns wrong results | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-147889@lists.php.net to get a copy of this message | ||
From: phpbugs at rizzt dot kicks-ass dot org
Operating system: linux
PHP version: 5.2.12
PHP Bug Type: Date/time related
Bug description: strtotime returns wrong results
Description:
------------
strtotime with "first day next month" or "last day next month" does not
work
Reproduce code:
---------------
echo strftime('1 %Y/%m/%d')."\n";
echo strftime('2 %Y/%m/%d', strtotime('first day'))."\n";
echo strftime('3 %Y/%m/%d', strtotime('last day'))."\n";
echo strftime('4 %Y/%m/%d', strtotime('next month'))."\n";
echo strftime('5 %Y/%m/%d', strtotime('first day next month'))."\n";
echo strftime('6 %Y/%m/%d', strtotime('last day next month'))."\n";
Expected result:
----------------
1 2010/02/20
2 2010/02/21
3 2010/02/19
4 2010/03/20
5 2010/03/01
6 2010/03/31
Actual result:
--------------
1 2010/02/20
2 2010/02/21
3 2010/02/19
4 2010/03/20
5 2010/03/21
6 2010/03/19
--
Edit bug report at http://bugs.php.net/?id=51096&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51096&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51096&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51096&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51096&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51096&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51096&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51096&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51096&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51096&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51096&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51096&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51096&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51096&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51096&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51096&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51096&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51096&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51096&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51096&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51096&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51096&r=mysqlcfg