Add support for git human format

This commit is contained in:
Trenton Broughton 2020-11-10 12:56:11 -05:00
parent 8d17101741
commit 5068ce76aa
2 changed files with 2 additions and 0 deletions

View File

@ -1206,6 +1206,7 @@ func TestToTimeEE(t *testing.T) {
{"Nov 10 23:00:00.000000000", time.Date(0, 11, 10, 23, 0, 0, 0, time.UTC), false}, // StampNano
{"2016-03-06 15:28:01-00:00", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false}, // RFC3339 without T
{"2016-03-06 15:28:01-0000", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false}, // RFC3339 without T or timezone hh:mm colon
{"Fri Sep 25 13:58:21 2020 -0400", time.Date(2020, 9, 25, 17, 58, 21, 0, time.UTC), false}, // git's human log format
{"2016-03-06 15:28:01", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false},
{"2016-03-06 15:28:01 -0000", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false},
{"2016-03-06 15:28:01 -00:00", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false},

View File

@ -1264,6 +1264,7 @@ func StringToDate(s string) (time.Time, error) {
time.StampMilli,
time.StampMicro,
time.StampNano,
"Mon Jan 2 15:04:05 2006 -0700", // git's human log format
})
}