|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-11-24 13:23 UTC] derick@php.net
-Status: Open
+Status: Not a bug
[2014-11-24 13:23 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 22:00:01 2026 UTC |
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"; }