|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 01:01:32 2024 UTC