This commit is contained in:
Gordon 2022-01-20 19:23:20 +08:00
parent 5a9f3f1f5e
commit 8e10533681

View File

@ -31,9 +31,7 @@ func UnixNanoSecondToTime(nanoSecond int64) time.Time {
return time.Unix(0, nanoSecond) return time.Unix(0, nanoSecond)
} }
func UnixMillSecondToTime(millSecond int64) time.Time { func UnixMillSecondToTime(millSecond int64) time.Time {
sec := millSecond / 1000 return time.Unix(0, millSecond*1e6)
msec := millSecond % 1000
return time.Unix(sec, msec*int64(time.Millisecond))
} }
//Get the current timestamp by Nano //Get the current timestamp by Nano