new format: 2017-12-11 10:16 no seconds closes #31

This commit is contained in:
Aaron Raddon
2017-12-11 10:53:38 -08:00
parent f30ca3179c
commit 39fde9de9e
2 changed files with 10 additions and 1 deletions

View File

@@ -668,7 +668,13 @@ iterRunes:
}
case stateDigitDashWs: // starts digit then dash 02- then whitespace 1 << 2 << 5 + 3
// 2013-04-01 22:43:22
return parse("2006-01-02 15:04:05", datestr, loc)
// 2013-04-01 22:43
switch len(datestr) {
case len("2013-04-01 22:43"):
return parse("2006-01-02 15:04", datestr, loc)
default:
return parse("2006-01-02 15:04:05", datestr, loc)
}
case stateDigitDashWsWsOffset:
// 2006-01-02 15:04:05 -0700