Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: can strftime show 'p.m.' instead of 'PM'?
- X-seq: zsh-users 17034
- From: TJ Luoma <luomat@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: can strftime show 'p.m.' instead of 'PM'?
- Date: Sat, 28 Apr 2012 17:45:46 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:content-transfer-encoding :content-disposition; bh=BChgrgZknoUzMwSzelEQi8FkyYo21bblMzwvE1L9lBo=; b=yQnPee1c/TykESq0RARVjC02eTAxxW0Ja86iaqCcfTu5iEWOv/p8amvumQ2xrk7kAu NeukIeecAlk+x2m6ZNyRsEkOuzgImxCBp5ig24MECdDKo4Fx8jGkcHwMebdBIiJb17Zy Wl1+Hl/UdpboTSlpIrWOxHvHY+IdlpEBt6+C0YFrRiD+etVp6+G5Ei9qIF2PkR+cfJeu JE8oPtlHNnPnu1T8X3kCvnh1a1wB3io1/zf/k4iUJMaUr959O/UGwp3W68VXasTDHhsq 65vF/yC//UXRM0dMaN8JSfuDXFcDAFJgwnJQGm77GUqepMB93aCDkrG/QK02L9vjdtIk czQw==
- In-reply-to: <alpine.LNX.2.01.1204281655300.27115@hp.internal>
- 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
- References: <29B9CC7BDEB94DA784265196AE5C7EEE@gmail.com> <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!
Messages sorted by:
Reverse Date,
Date,
Thread,
Author