php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #47431 Documentation misleading about time format
Submitted: 2009-02-18 01:42 UTC Modified: 2009-11-19 12:16 UTC
From: yamikuronue at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Windows XP running apache
Private report: No CVE-ID: None
 [2009-02-18 01:42 UTC] yamikuronue at gmail dot com
Description:
------------
The documentation claims that strtotime assumes US-English format; however, when the fields are separated with dashes, it reverts to UK-English format. 

Reproduce code:
---------------
$ICDate = "05-01-2012"; //actual code read from a file
$ICtimestamp = strtotime($ICDate);
$date = date ("F jS, Y", $ICtimestamp);
print $date; //actual code parsed through a template to display on a webpage

Expected result:
----------------
"May 1st, 2012"

Actual result:
--------------
"January 5th, 2012"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-18 11:15 UTC] rquadling@php.net
I just did a quick test using every ASCII character as a separator. 
Only 3 produced a non 1970 date...

05-01-2012 => January 5th, 2012
05.01.2012 => January 5th, 2012
05/01/2012 => May 1st, 2012

Odd indeed.



 [2009-11-19 12:16 UTC] vrana@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #36474.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 05:01:30 2024 UTC