|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-09-20 18:42 UTC] bugzilla33 at gmail dot com
Description: ------------ http://pl.php.net/manual/en/function.date.php http://pl.php.net/manual/en/function.gmdate.php Specification: u - Microseconds (added in PHP 5.2.2) - Example: 654321 u formater do not works because second parameter (called timestamp) is int type u formater will works if second parameter (called timestamp) is double (compatible with current int) Please remove u formater useless or fix specyfication or a better fix it int -> double (second parameter) Test script: --------------- <?=gmdate('u',12.13)?> <?=date('u',12.13)?> Expected result: ---------------- 130000 130000 Actual result: -------------- 000000 000000 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 02:00:01 2025 UTC |
Hi Salathe, I suspected that this was the case based on the API for date() at php.net and the NOTE section. I'm not disagreeing, but my issue is mainly with the documentation... So here's the part where I feel like I need to put in my 2 cents, and I do appreciate your ears regardless of the outcome. (You have been great so far.) With respect to what the NOTE section states, it would probably make more sense to do the following: (1) Disable this formatting character for date() and gmdate(), and specifically remove the formatting character from the documentation on the date() page. (2) Update the DateTime::format() page with an explicit list of formatting characters including the "u". After all, the "u" format character is completely useless in the context of date(), and it really should not be allowed at all. I just think it causes more confusion is all...unless perhaps in the future all PHP date functions will accept microtime(true) (with a precision of 6) instead of time(). Sincerely, John