Re: :format:%s for date fields seems to be shifted by timezone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 06, 2020 at 08:03:52PM +0200, clime wrote:

> what about just printing the raw timestamp from either commit or tag,
> i.e. avoiding any conversion for format:%s?

We don't parse the "%s" ourselves at all. We feed everything after the
colon to the system strftime(), and that function only takes a
broken-down "struct tm".

That said, we do already intercept "%z" for similar reasons in
strbuf_addftime(). So it would probably be possible to declare that we
don't respect system "%s" and just handle it ourselves. It would require
either massaging the "tm" back to a time_t, or changing the signature to
take a redundant time_t (and not all callers might have that).

So if somebody wants to work on a patch in that direction, we could see
how ugly it ends up being. But I am reasonably happy with "don't do
that" as a solution in the meantime.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux