|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-01-31 13:41 UTC] saad dot achemlal at gmail dot com
[2018-02-07 17:39 UTC] jhdxr@php.net
-Package: date_time
+Package: Date/time related
[2018-02-07 17:40 UTC] jhdxr@php.net
-Status: Open
+Status: Not a bug
[2018-02-07 17:40 UTC] jhdxr@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 20:00:01 2025 UTC |
Description: ------------ use DateTime() parse date error,such as Ym type:201501 、201512 I don't know user will input which time type,so i can't define a format like DateTime::createFromFormat('Ym', '201501') Test script: --------------- <?php $input = '201501'; $output = (new DateTime($input))->format('Ym'); echo $output; Expected result: ---------------- 201501 Actual result: -------------- 201801