git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Bug] git log - reports wrong date and time

From
COChanseok Oh <chanseok@google.com>
Date
Apr 1, 2019, 22:31 UTC
Message-ID
<CAP5K-1YJN9jt_6yEbLs=ET6M2tRLMMoio65GJMsJy69Y+LCn1g@mail.gmail.com>
Hello,
I'm using the latest version.
    $ git version
    git version 2.21.0.392.gf8f6787159e-goog
WORKS: the following prints out the date and time in my local timezone.
    $ git log '--date=format-local:%Y%m%d %H%M%S %z (%Z)' --format=%cd -n1
    20190401 170250 -0400 (EDT)
WORKS: "TZ=UTC" is respected. It prints time in UTC.
    $ TZ=UTC git log '--date=format-local:%Y%m%d %H%M%S %z (%Z)'
--format=%cd -n1
    20190401 210250 +0000 (UTC)
BROKEN: anything other than UTC reports wrong date.
    $ TZ=KST git log '--date=format-local:%Y%m%d %H%M%S %z (%Z)'
--format=%cd -n1
    20190401 210250 +0000 (KST)
The time is in UTC. Worse, %Z respects TZ=KST, which is in conflict with %z.

The symptom is same with "--date=local". It respects TZ=UTC but nothing other than TZ=UTC.

Regards, Chanseok

Next: Junio C Hamano
Message 1 of 3 in “[Bug] git log - reports wrong date and time”
  1. Chanseok OhApr 1, 2019
  2. Junio C HamanoApr 2, 2019
  3. Chanseok OhApr 2, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.