[Bug] git log - reports wrong date and time
- From
- Chanseok 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-googWORKS: 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