Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
can strftime show 'p.m.' instead of 'PM'?
- X-seq: zsh-users 17028
- From: TJ Luoma <luomat@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: can strftime show 'p.m.' instead of 'PM'?
- Date: Sat, 28 Apr 2012 14:55:25 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:subject:x-mailer:mime-version:content-type :content-transfer-encoding:content-disposition; bh=K24DFmXyuJ398tNW4XCXGeR3TA9qrIbYcxS2xjesd8A=; b=TMax340nQQ7zUXkjQNu0KIKrEtQATYjs7X6So1Km/lDdzFPHdxeWHwKapJraliD2Mh VJTgM716QZcAL/h25ISO9f/wn+uBNZvfvOtq5JgAQXW3Jawy0+REmCcY/Moz9+mlHuWU riA81gTAUJcMKoC0E+LymkTIw+Um8swptyP638r/6cR5aJgJbT+ziOLK2xY2pNdmUQIl yqey2Lk+yTWadImzFaCla+LAcmM9ZTaxniIUq7Oay/QmOiI+olK3oiOta1Jei3DlPBOo fbz6gV1eIZywpPmHbJlUAfGABRzJgBhTdOiLZ7NyxkYIBOTJuVz7dxzEhMsZwGniAI0W YtDg==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author