Bug #68492 [NEW]: Function strtotime() returns wrong values for some dates
| From: | anwendungsentwickler at gmail dot com | Date: | Mon, 24 Nov 2014 11:46:49 +0000 |
| Subject: | Bug #68492 [NEW]: Function strtotime() returns wrong values for some dates | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-188775@lists.php.net to get a copy of this message | ||
From: anwendungsentwickler at gmail dot com
Operating system: Windows 7
PHP version: 5.5.19
Package: Date/time related
Bug Type: Bug
Bug description:Function strtotime() returns wrong values for some dates
Description:
------------
The function strtotime returns in some cases wrong values - regarding to
the test script:
Returns:
24.06.08 : 2014-11-25
24.06.2008: 2008-06-24
----------------------
25.06.08 : 2008-06-25
25.06.2008: 2008-06-25
Expected:
24.06.08 : 2008-06-24
24.06.2008: 2008-06-24
----------------------
25.06.08 : 2008-06-25
25.06.2008: 2008-06-25
Tested on:
5.5.11 WIN
5.5.15 WIN
5.2.17 Linux
Test script:
---------------
<pre><?php
echo "PHP VERSION: ".PHP_VERSION."\n";
for($i = 1; $i <= 30; ++$i) {
$day = str_pad($i, 2, '0', STR_PAD_LEFT);
$dateTwo = "$day.06.08";
$dateFour = "$day.06.2008";
echo $dateTwo." : ".date("Y-m-d", strtotime($dateTwo));
echo "\n";
echo $dateFour.": ". date("Y-m-d", strtotime($dateFour));
echo "\n".str_repeat('-', 22)."\n";
}
--
Edit bug report at https://bugs.php.net/bug.php?id=68492&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68492&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68492&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68492&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68492&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68492&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68492&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68492&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68492&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68492&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68492&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68492&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68492&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68492&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68492&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68492&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68492&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68492&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68492&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68492&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68492&r=mysqlcfg