Decoder: check tz has : between hours and minutes (#691)

Fixes #690
This commit is contained in:
Thomas Pelletier
2021-11-30 20:22:11 -05:00
committed by GitHub
parent 4c7a337083
commit 3990899d7e
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -109,6 +109,10 @@ func parseDateTime(b []byte) (time.Time, error) {
return time.Time{}, newDecodeError(b[:1], "invalid timezone offset character")
}
if b[3] != ':' {
return time.Time{}, newDecodeError(b[3:4], "expected a : separator")
}
hours := digitsToInt(b[1:3])
minutes := digitsToInt(b[4:6])
seconds := direction * (hours*3600 + minutes*60)