#44188 [Opn->Bgs]: strtotime and excepting dates...
| From: | derick@php.net | Date: | Wed, 20 Feb 2008 16:06:23 +0000 |
| Subject: | #44188 [Opn->Bgs]: strtotime and excepting dates... | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-122511@lists.php.net to get a copy of this message | ||
ID: 44188
Updated by: derick@php.net
Reported By: rgermain at efiretechnologies dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux/Windows
PHP Version: 5.2.5
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Yup, that's correct. PHP 5.3 will have a better mechanism to parsing
formats that are not directly understood.
Previous Comments:
------------------------------------------------------------------------
[2008-02-20 15:25:02] rgermain at efiretechnologies dot com
Description:
------------
The strtotime() function doesn't except the date format mm-dd-yyyy. I
does however except dd-mm-yyyy. This is in version 5.2.5. In version
4.4.4 it does except the format of mm-dd-yyyy.
Reproduce code:
---------------
<?php
$one_day = 60 * 60 * 24;
for($i=0; $i < 365; $i++)
{
$new_day = $one_day * $i;
$new_date = time() + $new_day;
$fdate = date("m-d-Y", $new_date);
echo "<br>";
echo "Next day: " . $fdate . "<br>";
echo "StrtoTime: " . strtotime($fdate);
echo "<br>";
}
?>
Expected result:
----------------
All the days should output the correct date in the format of mm-dd-yyyy
and the strtotime should all output.
Actual result:
--------------
strtotime stops outputting on the 13th day and starts again on the 1st
of the following month.
This tells me that it only excepts dd-mm-yyyy.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44188&edit=1