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

Re: ambiguous git-log date and timestamp syntax

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 1, 2008, 17:10 UTC
Message-ID
<m3d4qejroy.fsf@localhost.localdomain>
In-Reply-To
<715587AA-D485-4B31-A786-D26334506007@gmail.com>
"Rhodes, Kate" <masukomi@gmail.com> writes:
Show 8 quoted lines
> The docs are a little vague on exactly what your options are when
> specifying dates. If someone can provide me some details on this I'll
> make a patch for the docs.
> 
> --since=date, --after=date
> 	Show commits more recent than a specific date.
> --until=date, --before=date
> 	Show commits older than a specific date.
Those are porcelain (meant for user) options.
> --max-age=timestamp, --min-age=timestamp
> 	Limit the commits output to specified time range.
Those are plumbing (meant for scripts) options.
For example git-rev-parse translates --since into --max-age, etc.
> From what I can tell it seems that dates can be specified relatively,
> e.g. "2 hours ago", or with any ISO 8601 or RFC 2822 date syntax. Is
> this correct, and are there any docs on specifying relative dates?

I don't know why git doesn't use getdate_r for this, instead rolling out its own date parsing routines: approxidate*, parse_date. From what I remember it should accept any date "date" (from coreutils) accepts, but it does (from comments) for date to be in "C" locale.

So I'm sorry, but I cannot help you here...
> I can't find any details on what the "timestamp" format should be. Can
> someone point me in the right direction?
Timestamp is Unix date (epoch), i.e. number of seconds since
1970-01-01 00:00:00 UTC, the format git uses for dates in commit and
tag objects.
 
Show 6 quoted lines
> -Kate == masukomi
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Rhodes, KateNext: Linus Torvalds
Message 2 of 9 in “ambiguous git-log date and timestamp syntax”
  1. Rhodes, KateMar 1, 2008
  2. Jakub NarebskiMar 1, 2008
  3. Linus TorvaldsMar 1, 2008
  4. Jakub NarebskiMar 1, 2008
  5. Johannes SchindelinMar 2, 2008
  6. Jakub NarebskiMar 2, 2008
  7. Johannes SchindelinMar 2, 2008
  8. Florian WeimerMar 2, 2008
  9. Documentation: Remove --{min,max}-age option from git-log(1)Jakub Narebski, Mar 2, 2008

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.