php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #49481 strftime format documentation error
Submitted: 2009-09-06 10:26 UTC Modified: 2009-09-06 10:41 UTC
From: liphtier at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.2.10 OS:
Private report: No CVE-ID: None
 [2009-09-06 10:26 UTC] liphtier at gmail dot com
Description:
------------
In the manual page: function.strftime stated

> %p 	UPPER-CASE 'AM' or 'PM' based on the given time
> Example: AM for 00:31, PM for 22:23
> %P 	lower-case 'am' or 'pm' based on the given time
> Example: am for 00:31, pm for 22:23


the actual format is exactly wise versa:
%p is  for lower-case and %P is for UPPER-CASE.



Reproduce code:
---------------
---
From manual page: function.strftime
---


Expected result:
----------------
> %P 	UPPER-CASE 'AM' or 'PM' based on the given time
> Example: AM for 00:31, PM for 22:23
> %p 	lower-case 'am' or 'pm' based on the given time
> Example: am for 00:31, pm for 22:23

Actual result:
--------------
> %p 	UPPER-CASE 'AM' or 'PM' based on the given time
> Example: AM for 00:31, PM for 22:23
> %P 	lower-case 'am' or 'pm' based on the given time
> Example: am for 00:31, pm for 22:23

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-06 10:41 UTC] derick@php.net
You are wrong.

From the Linux manual:

       %p     Either "AM" or "PM" according to the given time  value,  or  the
              corresponding  strings  for the current locale.  Noon is treated
              as "PM" and midnight as "AM".

       %P     Like %p but in lowercase: "am" or "pm" or a corresponding string
              for the current locale. (GNU)


In PHP:
php -r "echo strftime('%p %P' );"
AM am
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC