|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-20 04:02 UTC] stas@php.net
[2010-05-20 10:20 UTC] salathe@php.net
-Type: Bug
+Type: Documentation Problem
-Assigned To:
+Assigned To: derick
[2010-05-20 10:20 UTC] salathe@php.net
[2010-05-21 00:05 UTC] stas@php.net
-Type: Documentation Problem
+Type: Bug
[2010-05-21 00:05 UTC] stas@php.net
[2010-05-22 19:07 UTC] derick@php.net
-Assigned To: derick
+Assigned To: salathe
[2010-05-22 19:07 UTC] derick@php.net
[2010-05-22 21:13 UTC] salathe@php.net
[2010-05-22 21:23 UTC] salathe@php.net
-Status: Assigned
+Status: Closed
-Type: Bug
+Type: Documentation Problem
[2010-05-22 21:23 UTC] salathe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 23:00:01 2025 UTC |
Description: ------------ The manual for DateTime::createFromFormat says: Format accepted by date(). If format does not contain the character ! then portions of the date/time value specified in format but not specified in time will be set to the current system time. However if you specify format like "d-m-Y H:i" and provide datetime string that does not contain time, parsing would fail - even though the manual says if time string does not contain parts from format it should use current system. Test script: --------------- <?php $date = DateTime::createFromFormat("d-m-Y H:i", "25-10-2007"); var_dump($date); Expected result: ---------------- Something like: object(DateTime)#1 (3) { ["date"]=> string(19) "2007-10-25 18:58:31" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } Actual result: -------------- bool(false)