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

Re: orthogonal cases of log --date option

From
Jeff King <peff@peff.net>
Date
Mar 3, 2009, 08:34 UTC
Message-ID
<20090303083436.GD3158@coredump.intra.peff.net>
In-Reply-To
<buo8wnnrpcf.fsf@dhlpc061.dev.necel.com>
On Tue, Mar 03, 2009 at 05:18:56PM +0900, Miles Bader wrote:
Show 5 quoted lines
> I can use "git log --date=iso" to get YYYY-MM-DD format for dates, or
> "git log --date=local" to force the dates to use my local time zone, but
> if I use _both_ of these options together, it uses only the last one,
> and ignores any preceding --date (even those in this case, the two
> --date options affect orthogonal properties of dates).

Yuck. It sounds like --date=local is really the wrong way to have implemented it. It really should be:

  git log --date=iso --local-dates

I don't think there is currently a way to do what you want, but it is not too late to add an option (and keep --date=local as a synonym for --date=default --local-dates for compatibility).

> Is there a way to get YYYY-MM-DD format dates, but in my local
> time-zone?

Short of using --date=raw and munging the output with perl, I don't think so.

-Peff
Previous: Miles BaderNext: Junio C Hamano
Message 2 of 17 in “orthogonal cases of log --date option”
  1. Miles BaderMar 3, 2009
  2. Jeff KingMar 3, 2009
  3. Junio C HamanoMar 3, 2009
  4. Jeff KingMar 5, 2009
  5. Jay SoffianMar 5, 2009
  6. Jeff KingMar 5, 2009
  7. Junio C HamanoMar 5, 2009
  8. Jeff KingMar 6, 2009
  9. Junio C HamanoMar 6, 2009
  10. Jay SoffianMar 6, 2009
  11. Junio C HamanoMar 6, 2009
  12. Jay SoffianMar 6, 2009
  13. Junio C HamanoMar 6, 2009
  14. Jeff KingMar 6, 2009
  15. Jeff KingMar 6, 2009
  16. Jeff KingMar 6, 2009
  17. Miles BaderMar 6, 2009

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.