|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-02-20 16:06 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 21:00:01 2025 UTC |
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.