mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Steve Coffman <Steve.Coffman@ithaka.org>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: strptime.c missing timezone z case
Date: Wed, 19 Apr 2017 14:03:18 +0000	[thread overview]
Message-ID: <810C456D-EA4E-4759-B045-06E2FD26768C@ithaka.org> (raw)

I noticed that musl does not support timezone formats that include %z or %Z for timezone, unlike glibc.
Both %d/%b/%Y:%H:%M:%S %z and %d/%b/%Y:%H:%M:%S %Z for instance. 

When I change the timeformat to %d/%b/%Y:%H:%M:%S +0000 it works fine. Since we always use UTC, this works around the problem for us, but will affect any Alpine linux (docker) users that don't.
Looking through the musl source code to strptime.c <http://git.musl-libc.org/cgit/musl/tree/src/time/strptime.c> and strftime.c <https://github.com/BlankOn/musl/blob/master/src/time/strftime.c> I see that while strftime.c has a z case, strptime.c does not. My C is weak so that's about all I can suss out. Not sure if that's at all helpful.

More details of my investigation are here:

https://github.com/fluent/fluent-bit/issues/231


For comparison, glibc handles it this way: https://github.com/bminor/glibc/blob/master/time/strptime_l.c#L741

             reply	other threads:[~2017-04-19 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 14:03 Steve Coffman [this message]
2017-04-19 16:44 ` Szabolcs Nagy

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=810C456D-EA4E-4759-B045-06E2FD26768C@ithaka.org \
    --to=steve.coffman@ithaka.org \
    --cc=musl@lists.openwall.com \
    /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/musl/

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).