|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60089 DateTime::createFromFormat() U after u nukes microtime
Submitted: 2011-10-18 21:03 UTC Modified: 2016-10-05 20:00 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: Assigned: derickr (profile)
Status: Closed Package: Date/time related
PHP Version: trunk-SVN-2011-10-18 (SVN) OS:
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.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2011-10-18 21:03 UTC]
A format string containing a Unix timestamp at any point after a microsecond value 
leaves the microseconds unset in the resulting DateTime object.

Test script:


var_dump(DateTime::createFromFormat('u U', '123456 123456790')->format('U u'));


Expected result:
string(16) "123456790 123456"

Actual result:
string(16) "123456790 000000"


trunk-60089-quickfix (last revision 2011-10-18 21:07 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-18 21:03 UTC]
-Assigned To: +Assigned To: derickr
 [2011-10-18 21:07 UTC]
The following patch has been added/updated:

Patch Name: trunk-60089-quickfix
Revision:   1318972043
 [2016-10-05 20:00 UTC]
-Status: Assigned +Status: Closed
 [2016-10-05 20:00 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Fixed for PHP 7.1.0 RC4.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon May 29 22:03:40 2023 UTC