|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 23:00:01 2025 UTC |
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