unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* fromat-time-string: %p vs %P (feels backward:
@ 2017-04-25  0:11 raman
  2017-04-25  1:31 ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: raman @ 2017-04-25  0:11 UTC (permalink / raw)
  To: emacs-devel

See the following when evaluated in the *scratch* buffer on Emacs 26
built from head.

In the argument to format-time-string, %p produces am/pm in upper-case,
whereas %P produces lower-case.

(format-time-string  "%p")
"PM"
(format-time-string  "%P")
"pm"
-- 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fromat-time-string: %p vs %P (feels backward:
  2017-04-25  0:11 fromat-time-string: %p vs %P (feels backward: raman
@ 2017-04-25  1:31 ` Paul Eggert
  2017-04-25  2:58   ` raman
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2017-04-25  1:31 UTC (permalink / raw)
  To: raman, emacs-devel

On 04/24/2017 05:11 PM, raman wrote:
> In the argument to format-time-string, %p produces am/pm in upper-case,
> whereas %P produces lower-case.

It's awkward, but it's consistent with how glibc strftime works. For 
what it's worth, POSIX specifies %p to output upper-case in the C 
locale, and users likely expect that behavior.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fromat-time-string: %p vs %P (feels backward:
  2017-04-25  1:31 ` Paul Eggert
@ 2017-04-25  2:58   ` raman
  0 siblings, 0 replies; 3+ messages in thread
From: raman @ 2017-04-25  2:58 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

Paul Eggert <eggert@cs.ucla.edu> writes:


Interesting. I later realized that the documentation for
format-time-string only specifies the lower case version i.e. %p.
 > On 04/24/2017 05:11 PM, raman wrote:
>> In the argument to format-time-string, %p produces am/pm in upper-case,
>> whereas %P produces lower-case.
>
> It's awkward, but it's consistent with how glibc strftime works. For
> what it's worth, POSIX specifies %p to output upper-case in the C
> locale, and users likely expect that behavior.
>

-- 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-25  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25  0:11 fromat-time-string: %p vs %P (feels backward: raman
2017-04-25  1:31 ` Paul Eggert
2017-04-25  2:58   ` raman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).