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

Re: [Bug] git log - reports wrong date and time

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 2, 2019, 00:38 UTC
Message-ID
<xmqq7ecdutq2.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAP5K-1YJN9jt_6yEbLs=ET6M2tRLMMoio65GJMsJy69Y+LCn1g@mail.gmail.com>
Chanseok Oh <chanseok@google.com> writes:
Show 5 quoted lines
> 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)

I think you are probably on a system where timezones can be given only with a more modern and unambiguous style and not in the potentially ambiguous abbreviated form. Here is one experiment to show what I mean:

    $ TZ=KST date
    Tue Apr  2 00:29:51 KST 2019
    $ TZ=JST date
    Tue Apr  2 00:29:51 JST 2019
    $ TZ=Asia/Tokyo date
    Tue Apr  2 09:29:51 JST 2019
Two points to be learned from the above exercise are:
 - It is not limited to your copy of "git".  Even a system supplied
   command like "date" does not work with "JST" but it can grok
   Asia/Tokyo just fine ("JST" does not necessarily have to be
   "Japan standard time"; it could be Jamaican ;-)).
 - It is not limited to KST (is that Kabul standard time?  Khartoum?
   Kinshasa?).
Perhaps try TZ=Asia/Seoul or something?
Previous: Chanseok OhNext: Chanseok Oh
Message 2 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.