#44286 [Com]: date('u'): milli or microseconds?

From: Date: Wed, 27 Aug 2008 18:06:15 +0000
Subject: #44286 [Com]: date('u'): milli or microseconds?
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1130@lists.php.net to get a copy of this message
ID: 44286 Comment by: ross dot masters dot rm at googlemail dot com Reported By: carsten at bitbybit dot dk Status: Open Bug Type: Documentation problem Operating System: any PHP Version: Irrelevant New Comment: The source (below) case 'u': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%06d", (int) floor(t->f * 1000000)); break; Which is 10^-6 - microseconds. I don't have a CVS account but here's a small docbook patch for it: Index: phpdoc/en/reference/datetime/functions/date.xml --- phpdoc/en/reference/datetime/functions/date.xml Base (1.42) +++ phpdoc/en/reference/datetime/functions/date.xml Locally Modified (Based On 1.42) @@ -214,7 +214,7 @@ </row> <row> <entry><literal>u</literal></entry> - <entry>Milliseconds (added in PHP 5.2.2)</entry> + <entry>Microseconds (added in PHP 5.2.2)</entry> <entry>Example: <literal>54321</literal></entry> </row> <row> Previous Comments: ------------------------------------------------------------------------ [2008-02-28 20:21:25] carsten at bitbybit dot dk Description: ------------ According to current documentation, date('u') returns "Milliseconds (added in PHP 5.2.2) | Example: 54321". I suspect that what is meant is microseconds (10^-6 s), not milliseconds (10^-3 s). Otherwise, the example value doesn't make sense. Reproduce code: --------------- shell> php -r 'echo shell> date("u")."\n".date("u")."\n";' Expected result: ---------------- microseconds, not milliseconds Actual result: -------------- microseconds (apparently) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44286&edit=1

« previous php.doc.bugs (#1130) next »