php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #49754 date's documentation about 'u' implies it actually works
Submitted: 2009-10-02 19:02 UTC Modified: 2009-10-02 19:58 UTC
From: urkle at outoforder dot cc Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.2.11 OS: CentOS 5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: urkle at outoforder dot cc
New email:
PHP Version: OS:

 

 [2009-10-02 19:02 UTC] urkle at outoforder dot cc
Description:
------------
The documentation currently states.

u  	Microseconds (added in PHP 5.2.2)  	Example: 654321

which contradicts the result of bug #41806 http://bugs.php.net/bug.php?id=41806

which states that because date() only accepts an integer and uses time() which only returns an integer the 'u' formatting option will ONLY return 000000.

This severely limits the usefulness of having that 'u' formatting option.

Can the documentation either be updated to reflect that it will ONLY return '000000' OR can the date() be modified to use microtime() when possible and to accept a float so the 'u' format option can be useful.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-02 19:58 UTC] bjori@php.net
Scroll a little further down and you'll see
"Note: Since this function only accepts integer timestamps the u format character is only useful when using the date_format() function with user based timestamps created with date_create(). "

Since all the format characters are listed on the date() page, this will stay like this until the table can be refactored into its own appendix.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 12:00:01 2026 UTC