There are already some useful correct answers (for example, git log --since="6am" ), but it is strange that the documentation does not have special Git dates (at least googling "yesterday" "noon": git -scm.com does not return results).
There are ways to find out what is available, for example, answers to the Specification for Git date syntax are especially useful. In one, Ryan O'Hara points out that
it seems to accept all formats that it can output, as described in the documentation for the --date option:
--date=(relative|local|default|iso|rfc|short|raw)
Effective only for dates displayed in a readable format, for example when using --pretty . log.date config sets the default value for the --date command --date .
--date=relative shows dates relative to the current time, for example. 2 hours ago.
--date=local shows the timestamps in the local time zone of users.
--date=iso (or --date=iso8601 ) shows timestamps in ISO 8601 format.
--date=rfc (or --date=rfc2822 ) shows RFC 2822 timestamps that are often found in e-mail messages.
--date=short shows only the date, but not the time, in the format YYYY-MM-DD .
--date=raw shows the date in the raw format Git format %s %z .
--date=default shows the timestamps in the original time zone (commiters or authors).
My favorite answer is from me_and , which directs us to the Git date. c class . Scan this and you will find this code (at the time of writing, it is on line 925):
static const struct special { const char *name; void (*fn)(struct tm *, struct tm *, int *); } special[] = { { "yesterday", date_yesterday }, { "noon", date_noon }, { "midnight", date_midnight }, { "tea", date_tea }, { "PM", date_pm }, { "AM", date_am }, { "never", date_never }, { "now", date_now }, { NULL } };
I definitely use git log --before=tea , although looking at the date_tea function, I don't think they read Rupert Brooke :
static void date_tea(struct tm *tm, struct tm *now, int *num) { date_time(tm, now, 17); }