This commit is contained in:
aozhiwei 2024-06-21 17:36:23 +08:00
parent 9afe1aa679
commit a26208f76e

View File

@ -281,6 +281,9 @@ func SmartParseTimeToMills(timeStr string) int64 {
} }
} else if StrContains(timeStr, ".") { } else if StrContains(timeStr, ".") {
const layout = "2006-01-02 15:04:05.000" const layout = "2006-01-02 15:04:05.000"
if len(timeStr) > len(layout) {
timeStr = timeStr[0:len(layout)]
}
t, err := time.Parse(layout, timeStr) t, err := time.Parse(layout, timeStr)
if err == nil { if err == nil {
return t.UnixNano() / int64(time.Millisecond) return t.UnixNano() / int64(time.Millisecond)