From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20754 invoked by alias); 9 Jul 2015 04:36:59 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35740 Received: (qmail 14454 invoked from network); 9 Jul 2015 04:36:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=ww0PA3x7EWkeOW60xaXW1h7hqEkkG30VC0XYFWnxu/M=; b=r7grHFA+ky/CoTi7DVr6nG+Q8mLeRvd24In209AcX4QUGz9MkX2vzFlZGU+dGcWh4S niIFPJW/t+grE+t2hXJq8fVarIb3YKHegvvqDa2J5ntToeeyl5pzSkUOo8LqbqcFZym8 e+YH7u1Hcr9jbBuqZ2mSdxcCc13QeF8inX1LzWo8HB4NZwvWj1qy2ePCfFhwowt4gQ9k 1LcLiVnz4d4E1LHeckD08jbeM8S070X85/Wz1RHLDVQ569Z/vsq7LLsaltrjgI7kFix/ pPto59c+HUWdCeZM4Xv4fBW32O9vu8GESj4fv+BrhrYEVhy0DB2pHTTGnSyRNhEqnGe2 4OVA== MIME-Version: 1.0 X-Received: by 10.107.4.6 with SMTP id 6mr24377427ioe.49.1436416614419; Wed, 08 Jul 2015 21:36:54 -0700 (PDT) In-Reply-To: References: <1436310900-9519-1-git-send-email-mikachu@gmail.com> Date: Thu, 9 Jul 2015 06:36:54 +0200 Message-ID: Subject: Re: PATCH: Make ztrftime pass more things to strftime From: Mikael Magnusson To: "Jun T." Cc: zsh workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Jul 8, 2015 at 4:03 PM, Jun T. wrote= : > > 2015/07/08 08:21, Mikael Magnusson wrote: >> % print -P %D\{%x\} >> 2015=E5=B9=B407=E6=9C=8808=E6=97=A5 >> % print -P %D\{%Ex\} >> =E5=B9=B3=E6=88=9027=E5=B9=B407=E6=9C=8808=E6=97=A5 > > It works for %Ex but not for %Ey. > ztrftime() does not send %Ey to strftime() but ignores E and > handles %y by itself. > > % date +%y > 15 > % date +%Ey > 27 > % print -P '%D{%y %Ey}' > 15 15 > > Is it possible to pass the entire format string to strftime() > if HAVE_STRFTIME is defined? With my latest patch, I can now do this, % print -P '%D{%y %Ey %f}' 15 27 9 % date +'%y %Ey %f' 15 27 %f If anyone wants me to make %3f work, I humbly ask them to keep this to themselves. Bonus, weird stuff strftime() does: % date +%014EA #zeropadding the unchanged format string 00000000%014EA % date +%020Ey #padding Ey is fine 00000000000000000027 % date +%020Oy #but not Oy =E5=8D=81=E4=BA=94 % date +%_20Oe #not any O* it seems =E4=B9=9D % date +%020Oe #applies to english locale too 9 If you find any problems, please check that it doesn't happen with date with the same format string. --=20 Mikael Magnusson