From:             markjreed at mail dot com
Operating system: Any
PHP version:      5.0.3
PHP Bug Type:     Date/time related
Bug description:  Odd exception in strtotime parsing

Description:
------------
This doesn't seem to fall into the same category as the other strtotime()
bugs I found in the system.  Here is an example:

$ php -r 'echo strftime("%c\n", strtotime("0900 tomorrow"));'
Sat Jan 26 13:50:04 2008

If I add a colon to the time ("09:00 tomorrow"), or exchange the date and
time ("tomorrow 0900"), it produces the expected result. I don't know
quite what's going on here.  Note that Perl's Time::ParseDate::parsedate
function handles such strings properly.

The expected and actual output below are only for the particular moment
when I tried it; they will vary depending on the time of the test.

Reproduce code:
---------------
echo strftime("%c\n", strtotime("0900 tomorrow"));

Expected result:
----------------
Wed Aug 10 09:00:00 2005


Actual result:
--------------
Sat Jan 26 13:50:04 2008

-- 
Edit bug report at http://bugs.php.net/?id=34055&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34055&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34055&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34055&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34055&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34055&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34055&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34055&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34055&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34055&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34055&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34055&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34055&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34055&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34055&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34055&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34055&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34055&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34055&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34055&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34055&r=mysqlcfg

Reply via email to