zsh-users
 help / color / mirror / code / Atom feed
From: TJ Luoma <luomat@gmail.com>
To: zsh-users@zsh.org
Subject: Re: can strftime show 'p.m.' instead of 'PM'?
Date: Sat, 28 Apr 2012 17:45:46 -0400	[thread overview]
Message-ID: <2C541918E59F49F193E5EEBCE2C73CAF@gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.01.1204281655300.27115@hp.internal>



On Saturday, April 28, 2012 at 5:10 PM, Benjamin R. Haskell wrote:

> AFAIK, the strftime provided by zsh/datetime just passes its format
> string to the C library function. (So, right now, %p and %P get me 'PM'
> and 'pm', respectively.)


Ah! That explains why it seems to work sometimes but not others. I must have seen it differently on my Linux account on my web host.
 
> Since it's system-dependent, you're probably better off munging it
> yourself. But if you're extremely worried about efficiency, you don't
> need to pipe to `tr` or `sed` (so you can avoid launching an external
> process):
> 
> print -r - ${${${:-"$(strftime "%F %r" "$EPOCHSECONDS")"}/AM/a.m.}/PM/p.m.}
Terrific! Thanks.
 
I'm not so much worried about efficiency as I like to know what my alternatives are. I'm going to alias this anyway, so I might as well use the 'efficient' version.

(more below)

On Saturday, April 28, 2012 at 5:20 PM, Mark van Dijk wrote:

> One shall never debate the validity of taste. Unless it regards
> the dreadful modern popular music. 

These kids these days with their rock & roll music! :-)

 
> But in my experience the
> exploration of zsh is all about, erm, "picayunicies". 


If I ever create my own Linux distribution customized to my own preferences, I'm going to call it "picayunicies" :-)

TjL

ps - thanks!



  reply	other threads:[~2012-04-28 21:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-28 18:55 TJ Luoma
2012-04-28 21:10 ` Benjamin R. Haskell
2012-04-28 21:45   ` TJ Luoma [this message]
2012-04-28 21:20 ` Mark van Dijk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2C541918E59F49F193E5EEBCE2C73CAF@gmail.com \
    --to=luomat@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).