php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #9988 Documentation has incorrect example for date()
Submitted: 2001-03-26 03:44 UTC Modified: 2001-04-07 01:32 UTC
From: jcarnahan at networq dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.4pl1 OS: N/A
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: jcarnahan at networq dot com
New email:
PHP Version: OS:

 

 [2001-03-26 03:44 UTC] jcarnahan at networq dot com
The documentation for the date() function at:

http://www.php.net/manual/en/function.date.php

Has one example:

$today = date("D M j g:i:s T Y"); // Sat Mar 10 15:16:08 MST 2001

Note that it appears "g" has yeilded "15" ... This is incorrect:

g - hour, 12-hour format without leading zeros; i.e. "1" to "12" 

G - hour, 24-hour format without leading zeros; i.e. "0" to "23" 

That should either be a capital "G" in the date() function, or the example output should be changed to indicate that the hour is in 12-hour format.

--
Jeff Carnahan - jcarnahan@networq.com

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-07 01:32 UTC] danbeck@php.net
Corrected in phpdoc cvs.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 17:01:30 2025 UTC