zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: Make ztrftime pass more things to strftime
Date: Thu, 9 Jul 2015 06:36:54 +0200	[thread overview]
Message-ID: <CAHYJk3SP++8f71J9Yank4Axwavn8DbWQ+h4KSrjmTzCC=N2pRw@mail.gmail.com> (raw)
In-Reply-To: <D4FC70DD-31AF-489A-89C6-5F6A6FED1BFD@kba.biglobe.ne.jp>

On Wed, Jul 8, 2015 at 4:03 PM, Jun T. <takimoto-j@kba.biglobe.ne.jp> wrote:
>
> 2015/07/08 08:21, Mikael Magnusson <mikachu@gmail.com> wrote:
>> % print -P %D\{%x\}
>> 2015年07月08日
>> % print -P %D\{%Ex\}
>> 平成27年07月08日
>
> 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
十五
% date +%_20Oe #not any O* it seems
九
% 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.

-- 
Mikael Magnusson


  reply	other threads:[~2015-07-09  4:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 23:15 Mikael Magnusson
2015-07-07 23:21 ` Mikael Magnusson
2015-07-08 10:53   ` Peter Stephenson
2015-07-09  5:16     ` Mikael Magnusson
2015-07-09  8:41       ` Peter Stephenson
2015-07-09  9:58         ` PATCH: ztrftime: Pass everything unhandled to the system strftime() Mikael Magnusson
2015-07-09 10:17           ` Peter Stephenson
2015-07-10 13:37             ` Peter Stephenson
2015-07-10 16:18               ` Skipping tests (was Re: PATCH: ztrftime: Pass everything ...) Bart Schaefer
2015-07-10 16:23                 ` Peter Stephenson
2015-07-10 18:31               ` PATCH: ztrftime: Pass everything unhandled to the system strftime() Daniel Shahaf
2015-07-10 23:54                 ` ZTST_skip (was Re: PATCH: ztrftime ...) Bart Schaefer
2015-07-09 15:52           ` PATCH: ztrftime: Pass everything unhandled to the system strftime() Jun T.
2015-07-10 14:53           ` Jun T.
2015-07-10 18:23             ` Mikael Magnusson
2015-07-27 11:56           ` Jun T.
2015-07-27 13:31             ` Mikael Magnusson
2015-07-27 16:50               ` Jun T.
2015-07-27 17:01               ` Jun T.
2015-09-01 13:53           ` Oliver Kiddle
2015-09-01 14:07             ` Peter Stephenson
2015-09-01 21:16             ` PATCH: Avoid gcc case syntax Mikael Magnusson
2015-07-08 14:03   ` PATCH: Make ztrftime pass more things to strftime Jun T.
2015-07-09  4:36     ` Mikael Magnusson [this message]
2015-07-08 10:39 ` Peter Stephenson

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='CAHYJk3SP++8f71J9Yank4Axwavn8DbWQ+h4KSrjmTzCC=N2pRw@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@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).