zsh-users
 help / color / mirror / code / Atom feed
* can strftime show 'p.m.' instead of 'PM'?
@ 2012-04-28 18:55 TJ Luoma
  2012-04-28 21:10 ` Benjamin R. Haskell
  2012-04-28 21:20 ` Mark van Dijk
  0 siblings, 2 replies; 4+ messages in thread
From: TJ Luoma @ 2012-04-28 18:55 UTC (permalink / raw)
  To: zsh-users


Before I begin, I should say that I realize this may (seem to) be extremely picayune, but it consistently annoys me. Judge me as you will :-)

`man strftime` says this:

     %p    is replaced by national representation of either "ante meridiem" (a.m.)  or "post meridiem" (p.m.)  as appropriate.

     %F    is equivalent to ``%Y-%m-%d''.

     %r    is equivalent to ``%I:%M:%S %p''.

However when I do this in zsh

$ strftime "%F %r" "$EPOCHSECONDS"

I get this:

2012-04-28 02:50:24 PM

Ideally I would like "PM" to be "p.m." but I'd probably settle for "pm"

I tried using '%P' instead of '%p' (thinking that might invert the case) but that just gave me a literal 'P' instead.

I realize that I could use:

strftime "%F %r" "$EPOCHSECONDS" | tr '[A-Z]' '[a-z]'

or even

strftime "%F %r" "$EPOCHSECONDS" | sed 's#AM#a.m#g; s#pPM#p.m.#g'

but I wondered if there was a better (more efficient) way.

Thanks

TjL




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

end of thread, other threads:[~2012-04-28 21:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-28 18:55 can strftime show 'p.m.' instead of 'PM'? TJ Luoma
2012-04-28 21:10 ` Benjamin R. Haskell
2012-04-28 21:45   ` TJ Luoma
2012-04-28 21:20 ` Mark van Dijk

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

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).