|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
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.