php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44188 strtotime and excepting dates...
Submitted: 2008-02-20 15:25 UTC Modified: 2008-02-20 16:06 UTC
From: rgermain at efiretechnologies dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.5 OS: Linux/Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rgermain at efiretechnologies dot com
New email:
PHP Version: OS:

 

 [2008-02-20 15:25 UTC] 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-20 16:06 UTC] derick@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC