#45116 [Opn]: Changed behaviour of strtotime

From: Date: Tue, 15 Jul 2008 09:38:26 +0000
Subject: #45116 [Opn]: Changed behaviour of strtotime
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-953@lists.php.net to get a copy of this message
ID: 45116 Updated by: derick@php.net Reported By: ickmund at gmail dot com Status: Open -Bug Type: Date/time related +Bug Type: Documentation problem Operating System: 2.6.15-1.1831_FC4 PHP Version: 5.2.6 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2008-05-28 12:47:31] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45116&edit=1

« previous php.doc.bugs (#953) next »