|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #52514 microseconds are missing in DateTime class
Submitted: 2010-08-02 13:44 UTC Modified: 2016-10-07 17:40 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: giorgio dot liscio at email dot it Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5.3.3 OS: all? xp x64
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:
From: giorgio dot liscio at email dot it
New email:
PHP Version: OS:


 [2010-08-02 13:44 UTC] giorgio dot liscio at email dot it

i expected to dump microseconds too when i use

new DateTime("now");
new DateTime(date('Y-m-d H:i:s.283020,time()));

but apparently they are not stored at all in datetime objects

echo date('Y-m-d H:i:s.u',microtime(true));

or in classical php functions

thank you


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-07 00:38 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: derick
 [2010-08-07 02:45 UTC] giorgio dot liscio at email dot it
hi, thank you for accepting this bug

microseconds must be stored for example in:

"+5 weeks"
"-7 weekdays"

in practice, when the date-time is relative to "now"

in plus must works (and apparently works) full microseconds support when datetime is instantiated through createFromFormat()

see too

thank you for creating this library, love oop dates :)
 [2011-01-22 08:50 UTC]
-Type: Bug +Type: Feature/Change Request
 [2016-10-05 20:03 UTC]
The issue from the title is fixed for PHP 7.1.0 RC4, but you can't use "ms" or the like with DateTime->modify yet.
 [2016-10-07 17:40 UTC]
-Status: Assigned +Status: Closed
 [2016-10-07 17:40 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.0RC4.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Jun 02 08:03:37 2023 UTC