php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66143 Wrong documentation on "Time Formats"
Submitted: 2013-11-22 02:21 UTC Modified: 2013-11-26 07:20 UTC
From: k dot kennypu at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant 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: k dot kennypu at gmail dot com
New email:
PHP Version: OS:

 

 [2013-11-22 02:21 UTC] k dot kennypu at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/datetime.formats.time
---
Wrong documentation for displaying AM/PM. 

In Documentation:
"Description" : "meridian"
"Examples"    : "A.m, pM, am."

Expected Behavior when use in use in code:
"time is: 00:00 AM/PM"

Actual Behavior:
"time is: 00:00 00UTCMon, XX Nov XXXX 00:00:00 + 0000000..00pm11"

Fix:
Documentation should say "Description" : "A/a", not meridian, it does not do what it says it does.



Test script:
---------------
echo "time is: " . date("h:i meridian", time() );

//real code is echo "time is: " . date("h:i A", time() );

Expected result:
----------------
"time is: 00:00 AM/PM"

Actual result:
--------------
"time is: 00:00 00UTCMon, XX Nov XXXX 00:00:00 + 0000000..00pm11"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-22 04:47 UTC] gabri dot ns at gmail dot com
those page are for explaining what kind of time format did PHP understand. To use "date" function, please read http://php.net/date
 [2013-11-26 07:20 UTC] frozenfire@php.net
-Status: Open +Status: Not a bug
 [2013-11-26 07:20 UTC] frozenfire@php.net
It is resulting in this behaviour because you are passing a series of formatting codes to the date function in the form of "meridian".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 10:01:33 2025 UTC