Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: can strftime show 'p.m.' instead of 'PM'?




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!




Messages sorted by: Reverse Date, Date, Thread, Author