Doc #69789 [Opn]: date() documentation regarding microseconds in misleading

From: Date: Wed, 10 Jun 2015 19:36:42 +0000
Subject: Doc #69789 [Opn]: date() documentation regarding microseconds in misleading
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12404@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69789&edit=1 ID: 69789 Updated by: aharvey@php.net Reported by: patrick dot schwisow at gmail dot com Summary: date() documentation regarding microseconds in misleading Status: Open Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

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