php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #45116 Changed behaviour of strtotime
Submitted: 2008-05-28 12:47 UTC Modified: 2008-11-05 16:35 UTC
From: ickmund at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.2.6 OS: 2.6.15-1.1831_FC4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ickmund at gmail dot com
New email:
PHP Version: OS:

 

 [2008-05-28 12:47 UTC] ickmund at gmail dot com
Description:
------------
In earlier versions (5.0.4 tested) strtotime("080630") would work as if the input was formatted as "ymd". Tested in 5.2.6, it is formatted as "His".

Bug or not, it has changed and no documentation can be found?

PHP 5.2.6
php -r "echo date('Y-m-d H:i:s', strtotime('080630'));"
2008-05-28 08:06:30

PHP 5.0.4
php -r "echo date('Y-m-d H:i:s', strtotime('080630'));"
2008-06-30 00:00:00



Reproduce code:
---------------
php -r "echo date('Y-m-d H:i:s', strtotime('080630'));"

Expected result:
----------------
2008-06-30 00:00:00

Actual result:
--------------
2008-05-28 08:06:30

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-15 09:38 UTC] derick@php.net
It's meant to work like in 5.2.6 - there is plenty of issues with the format, like you can see here:

# php-5.0.3  -r "echo date('Y-m-d H:i:s', strtotime('081330'));"
2009-01-30 00:00:00

Having as output 2008-07-15 08:13:30 is quite more logically here. For other people, the above format could also mean "August 13, 2030" or something else. There is documentation, but it's in Latex (and thus not useful for inclusion in the PHP documentation) right now.

 [2008-11-05 16:35 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.

Bug #36474.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 20:01:32 2024 UTC