I have logs with timestamps that look like "2020-05-08 22:02:00,845". They have comma separated milliseconds, which is what is giving time.Parse issues. I can't seem to figure out how to make time.Parse happy with it. Here is sample code that produces the error in go version go1.13.4 darwin/amd64 (and in the playground linked below);
package main
import (
"time"
)
func main() {
ts := "2020-05-08 22:02:00,845"
_, err := time.Parse("2006-01-02 15:04:05,000", ts)
print(err.Error())
}
Running that code produces this error
parsing time "2020-05-08 22:02:00,845" as "2006-01-02 15:04:05,000": cannot parse "845" as ",000"
Here a link to the code in the go playground
So what would a format look like to parse this? Thanks for your help.