Doc #69789 [Opn->Csd]: date() documentation regarding microseconds in misleading
Edit report at https://bugs.php.net/bug.php?id=69789&edit=1
ID: 69789
Updated by: cmb@php.net
Reported by: patrick dot schwisow at gmail dot com
Summary: date() documentation regarding microseconds in
misleading
-Status: Open
+Status: Closed
Type: Documentation Problem
-Package: Documentation problem
+Package: Date/time related
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2015-06-10 19:36:40] aharvey@php.net
It's a shame that creating DateTime objects with microsecond resolution is as hard as it is, so
it probably is worth noting this at the point where you'd generally want to use them. Good job!
Some feedback on the patch itself (none of this is bad; more just a reflection of our norms for the
manual â coding style, if you will):
- It's rare that we directly reference bug reports in the manual (in fact, there's only
one reference page that does so at present, and that one's probably wrong). I don't mind
noting that it's harder than it should be to create a DateTime with microseconds and describing
how to do so, but we probably don't need a link to the bug report as such.
- If the reference does stay in, the usual format would be to link using an entity for the base:
this would be something like
<link xlink:href="&url.php.bugs;49779">#49779</link>. In general, we never
place direct URLs in the manual, as this makes it harder for translators: genuinely new URLs (which
this isn't, of course, as we have url.php.bugs already) go into doc-base/entities/global.ent
and are then referenced from the reference page(s) that need them.
- Class names should be surrounded by <classname>, so
<classname>DateTime</classname> â this is for both formatting and linking
reasons.
------------------------------------------------------------------------
[2015-06-09 20:17:15] patrick dot schwisow at gmail dot com
Description:
------------
On http://php.net/manual/en/function.date.php,
'u' is defined as:
"Microseconds (added in PHP 5.2.2). Note that date() will always generate 000000 since it takes
an integer parameter, whereas DateTime::format() does support microseconds."
While this is not incorrect, it would lead you to believe that most DateTime objects will return
microseconds. However, https://bugs.php.net/bug.php?id=49779 prevents this
from working properly without a workaround.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69789&edit=1
Thread (3 messages)