Bug #55015 [NEW]: strToTime calculates wrong date

From: Date: Thu, 09 Jun 2011 12:13:00 +0000
Subject: Bug #55015 [NEW]: strToTime calculates wrong date
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-161262@lists.php.net to get a copy of this message
From:             
Operating system: Linux
PHP version:      5.3.6
Package:          Date/time related
Bug Type:         Bug
Bug description:strToTime calculates wrong date

Description:
------------
Hi,

strToTime calculates a "Wednesday" when i asked for a "Monday".

php 5.3.6
Configure Command =>  './configure'  '--disable-cgi'
'--with-libedit'
PHP API => 20090626
PHP Extension => 20090626
Zend Extension => 220090626
Zend Extension Build => API220090626,NTS
PHP Extension Build => API20090626,NTS


Test script:
---------------
// today Y-m-d 2011-06-09 
date_default_timezone_set('Europe/Berlin');
echo date('Ymd N', strToTime('next month next Monday'));



Expected result:
----------------
20110711 1

Actual result:
--------------
20110713 3

-- 
Edit bug report at http://bugs.php.net/bug.php?id=55015&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=55015&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=55015&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=55015&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=55015&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=55015&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=55015&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=55015&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=55015&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=55015&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=55015&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=55015&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=55015&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=55015&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=55015&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=55015&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=55015&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=55015&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=55015&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=55015&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=55015&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=55015&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#161262) next »