|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41806 milliseconds in date function
Submitted: 2007-06-25 23:53 UTC Modified: 2007-07-12 19:04 UTC
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: lordi at msdi dot ca Assigned: derick (profile)
Status: Not a bug Package: Date/time related
PHP Version: 5.2.3 OS: FreeBSD 6.2-RELEASE
Private report: No CVE-ID: None
 [2007-06-25 23:53 UTC] lordi at msdi dot ca

the "u" parameters in the date function should return milliseconds, but it always returns zeros.

Reproduce code:
echo date ('H:i:s:u');

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-26 00:27 UTC]
I think someone forgot to commit the part to the ext/date/lib/ side of things when adding 'u' format as I can't see anywhere where t->f would be set to anything but 0..
 [2007-07-12 19:04 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

This is correct, it states that the timestamp is an integer, and that it defaults to the value of "time()" in the documentation. time() does not return a float with fractions of a second:
Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given. In other words, timestamp  is optional and defaults to the value of time().
 [2011-02-16 19:19 UTC] somemail at gmail dot com
The problem still exists (Debian, PHP 5.2.6-1), even though the example wasn't good enough.

Reproduce code:
echo date('H:i:s.u', microtime(true));
echo microtime(true);


PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Apr 11 08:01:23 2021 UTC