Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 1 | DATE FORMATS |
| 2 | ------------ |
| 3 | |
Junio C Hamano | a372d5b | 2021-02-26 01:34:37 | [diff] [blame] | 4 | The `GIT_AUTHOR_DATE` and `GIT_COMMITTER_DATE` environment variables |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 5 | support the following date formats: |
| 6 | |
| 7 | Git internal format:: |
Junio C Hamano | e3acfb8 | 2013-11-12 23:22:57 | [diff] [blame] | 8 | It is `<unix timestamp> <time zone offset>`, where `<unix |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 9 | timestamp>` is the number of seconds since the UNIX epoch. |
Junio C Hamano | e3acfb8 | 2013-11-12 23:22:57 | [diff] [blame] | 10 | `<time zone offset>` is a positive or negative offset from UTC. |
Junio C Hamano | 52b1cfb | 2016-12-20 00:18:36 | [diff] [blame] | 11 | For example CET (which is 1 hour ahead of UTC) is `+0100`. |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 12 | |
| 13 | RFC 2822:: |
| 14 | The standard email format as described by RFC 2822, for example |
| 15 | `Thu, 07 Apr 2005 22:13:13 +0200`. |
| 16 | |
| 17 | ISO 8601:: |
| 18 | Time and date specified by the ISO 8601 standard, for example |
| 19 | `2005-04-07T22:13:13`. The parser accepts a space instead of the |
Junio C Hamano | dd4c178 | 2020-05-05 22:34:54 | [diff] [blame] | 20 | `T` character as well. Fractional parts of a second will be ignored, |
| 21 | for example `2005-04-07T22:13:13.019` will be treated as |
Junio C Hamano | 0beab6c | 2020-05-26 18:32:25 | [diff] [blame] | 22 | `2005-04-07T22:13:13`. |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 23 | + |
| 24 | NOTE: In addition, the date part is accepted in the following formats: |
| 25 | `YYYY.MM.DD`, `MM/DD/YYYY` and `DD.MM.YYYY`. |
Junio C Hamano | a372d5b | 2021-02-26 01:34:37 | [diff] [blame] | 26 | |
| 27 | ifdef::git-commit[] |
| 28 | In addition to recognizing all date formats above, the `--date` option |
| 29 | will also try to make sense of other, more human-centric date formats, |
| 30 | such as relative dates like "yesterday" or "last Friday at noon". |
| 31 | endif::git-commit[] |